Tuesday, March 3, 2009

wordpress - disable/enable comments on all posts

Since I finally got a chance to enable CAPTCHA on my personal blog which uses wordpress, I needed a quick to way to turn on comments that I had disabled for my posts.

This tutorial was good, but I do not have myPhpAdmin.

So, my steps were:

mysql -u -p
mysql> show tables;
+--------------------+
tables in ....
+--------------------+

....
mysql> UPDATE wp_posts p SET comment_status = 'open' ping_status = 'open' where comment_status = 'closed';

Of course, to reverse this:

mysql> UPDATE wp_posts p SET comment_status = 'closed' ping_status = 'closed' where comment_status = 'open';

worked like a charm.

--- Addition

Enabling comments was fine, but the SpamBots are now abusing the trackbacks option. So, I need to disable trackbacks too.

mysql> UPDATE wp_options SET option_value = 'closed' WHERE wp_options.option_id =20 AND wp_options.blog_id =0;

No comments: