Disable All Posts Comments in WordPress

Disable All Posts Comments in WordPress

? The Snippet:

UPDATE wp_posts SET comment_status = 'closed', ping_status = 'closed';

ℹ️ About the Snippet

If you want to disable all posts comments in WordPress. Then, there are few ways to do that. The simple solution can be by installing a Plugin which can disable the comments of any specific post or all the posts comments quickly without any coding but here comes a question i.e. “Why to install a plugin just to disable the comments?”. In fact, this is a valid question.

✅ How to use the Snippet

Most of the time a plugin contains a lot of other features and resource files which we don’t need for a particular task. As a result, this slows down the site’s speed and that delay can lose the traffic which means you can lose the leads, sales or subscribers.

To do this task simply, we can use a very small code snippet and the process is really simple. For this reason below are some steps explained to disable all posts comments in WordPress if you have a bit knowledge of using phpMyAdmin

Steps to use this code snippet to disable all posts comments:

  1. Open your website’s “phpMyAdmin”

  2. Select your Database

  3. Click on “SQL” Tab

  4. Paste the below code snippet in “Run SQL Query” Box

UPDATE wp_posts SET comment_status = 'closed', ping_status = 'closed';

Once you follow above mentioned steps, click on any of the post. When you scroll to the page. You’ll see instead of Comments Box it’ll show a message i.e “Comments are closed.”

In spite of the snippet shared in this guide. Let us know in the comments if you have any query. Don’t worry because we didn’t turn off our comments?

Sharing is caring!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get regular WordPress updates directly in your inbox.