← Back to Archives

Disable comments on historical posts in Wordpress via MySQL

blogging

So, here's a quick chunk of MySQL that you can run in phpMyAdmin's MySQL tab to disable comments on all posts before a certain date:

Update wp_posts set comment_status = "closed" where post_date < "2005-04-20";

It's dissapointing that I have to go nuclear on the p2p blog. I'd much rather have a comment/trackback/referrer spam solution in Wordpress as exists in b2evolution. Oh well.

UPDATE [2005-09-11 10:46:20]: You can also use this to shut off trackbacks by changing comment_status above to ping_status.

UPDATE [2005-12-01T11:20:05]: Added a semicolon at the end of the statement above. To do this in b2evolution, you would do something like this:

Update evo_posts set post_comments = "closed" where post_issue_date < "2005-10-31 00:00:01";