Disable Comments for All Wordpress Posts from Phpmyadmin

Disable Comments for All WordPress Posts from Phpmyadmin

Below is a quick guide on how to disable comments for all WordPress Posts or Custom Post Types from Phpmyadmin

The idea here is to disable the comment_status to all WordPress Posts at once via Phpmyadmin.

Maybe you do not want people to comment on your pages or custom post types but you did not disabled the comment settings at the time of creation.

Well, you do not need to go through all the page and edit them one by one. To disable comments for all WordPress Posts. You will just need a simple query script to tap the database and update the settings on Phpmyadmin all at once.

Make sure to backup your database first!

Whether you turn off the WordPress comments on Posts, Pages or even Custom Post Types (if enabled). Just follow the guide below to achieve this.

Here’s the guide to disable comments for all WordPress Posts

I’m assuming that you have an access to your CPanel and Phpmyadmin. If not, you need to ask your host provider to grant you an access. But most of the provider grants these access to the user.

Login to Cpanel

Look for Phpmyadmin

Click your database and then click the wp_posts table. This is where you will run the script.

For Posts

UPDATE `wp_posts` SET `comment_status`='closed',`ping_status`='closed' WHERE `comment_status` = 'open' AND `post_type` = 'post';

For Pages

UPDATE `wp_posts` SET `comment_status`='closed',`ping_status`='closed' WHERE `comment_status` = 'open' AND `post_type` = 'page';

For Custom Post Type

UPDATE `wp_posts` SET `comment_status`='closed',`ping_status`='closed' WHERE `comment_status` = 'open' AND `post_type` = 'your_cpt_slug';

Then, run the query by clicking go.

That’s it!

Feel free to leave a comment if you have questions or clarifications.