Closing old posts in WordpressMu
Tuesday, August 14th, 2007One feature from Roller that I really miss is the ability to have only the most recent entries open for comments. After dealing with lots of spam, I finally put together a solution. It’s very low tech; I run the following in a crontab for each blog:
echo "update wp_2_posts set comment_status = 'closed' where comment_status = 'open' and post_modified < date_sub(curdate(), interval 14 day) and post_status = 'publish' and post_type='post';" | mysql --user=xxxx --password=xxxx wordpress
