Dumb Things are Happening with Comments
Sunday, November 23rd, 2008I get a lot of spam comments on the blog here. You don’t see them, because I mark them as spam, a few hundred every week. They’re roughly uniformly distributed across all my posts. If fewer posts are open, I get fewer comments. So I want to minimize the number of comments I have to deal with.
I’m trying to use Mark Kenny’s Extended Comment Options plugin to automatically close comments on old posts. I used this plugin a long time ago, and it was great. But now, in WP 2.6, it seems to do exactly the inverse of what it says on the box: it closes my most recent posts and opens the oldest ones.
I don’t understand. Isn’t this just
UPDATE `wp_posts` SET `comment_status` = 'closed' WHERE `ID` IN (SELECT `ID` FROM `wp_posts` WHERE `post_status` = 'publish' AND `post_type` = 'post' ORDER BY `post_date_gmt` DESC) LIMIT 0,10
(Okay, it’s not quite that simple, because MySQL doesn’t do ORDER BY or LIMIT in subqueries… But it’s close! Temporary table?)
Has anybody got a good solution to this, better than a cron job to run that query?
Meanwhile, apologies to everyone who wanted to comment but couldn’t.