How to Enable or Disable WordPress Comments

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;

  1. First you need to log into your phpMyAdmin control applet.
  2. Next, locate and select your WordPress database on the left from the database dropdown list.
  3. Then, select the SQL tab from the navigation tabs at the top.
  4. 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;

  1. Login to your phpMyAdmin control panel.
  2. Select your WordPress database.
  3. Open the SQL tab.
  4. Run the following SQL Query, and click go.
UPDATE posts p SET comment_status = 'open', ping_status = 'open' WHERE comment_status = 'closed';