How to Enable or Disable WordPress Comments; You might be asking – How do I disable comments on WordPress without a Plugin? How can I enable comments for all posts?
With WordPress, you can globally disable comments if you do not want to allow comments to be placed on your blog. Since this information is stored in the database, we can edit the allow comments option (open or close comments) across the entire blog in one step.
The following tutorial explains how to remove all instances of Allow Comments by using an SQL database query.
Note: This process assumes that you are able to use phpMyAdmin to access your database.
Disable WordPress Comments on all Posts
To globally disable comments on all of your posts;
- First you need to log into your phpMyAdmin control applet.
- Next, locate and select your WordPress database on the left from the database dropdown list.
- Then, select the SQL tab from the navigation tabs at the top.
- Within the Run SQL Query box add the following code, and then click go.
UPDATE posts p SET comment_status = 'closed', ping_status = 'closed' WHERE comment_status = 'open';
If you get an error, check your wp_post prefix from the database list and change the code to match accordingly. That’s all there is to it! You have disabled the ability to comment on your posts across your entire blog.
Enable WordPress Comments on all Posts
To globally enable or re-enable comments on all posts;
- Login to your phpMyAdmin control panel.
- Select your WordPress database.
- Open the SQL tab.
- Run the following SQL Query, and click go.
UPDATE posts p SET comment_status = 'open', ping_status = 'open' WHERE comment_status = 'closed';