Knowledge Base » Blog Archive » Disable comments in WordPress

Disable comments in WordPress

April 19th, 2013

Leaving comments open without good captcha protection in WordPress can lead to a lot of spam and oversized databases. Here is a quick way to disable comments for all posts from PHPMyAdmin (which can be launched from your hosting control panel).

Click the SQL tab in PHPMyAdmin and run the two commands below, one by one. First, we disable commenting on all posts:

UPDATE wp_posts SET comment_status = 'closed';

Next, we globally disable pingbacks/trackbacks on all posts:

UPDATE wp_posts SET ping_status = 'closed';

If you have a lot of SPAM already in the comments table, click the checkbox next to wp_comments under the database structure tab and select “Empty” from the dropdown below the list of tables.