Top

Daily Tip: How to Disable Comments On Older Posts to Cut Down on Spam

August 16, 2010

If you’re getting a fair bit of spam on older blog posts, you may want to disable commenting on posts older than a year or two. Because your posts are still indexed by search engines, you’ll still be getting traffic there, but you may not want the burden of answering questions on posts that are obsolete.

You can easily do this in less than a minute with this SQL query. Sign in to phpmyadmin for your WordPress database and run this query:

UPDATE wp_posts SET comment_status = 'closed' WHERE post_date < '2009-01-01' AND post_status = 'publish';

You can change the date to whatever suits your site’s needs.

Source: Perishable Press

Tweet This Post

Comments

Got something to say?

Bottom
Article Archive  |  This site is a historical archive of pressography.com, a WordPress plugin and theme blog that published between 2006 and 2012. It is preserved for reference and is not operated by, affiliated with, or endorsed by its original authors. Nothing here is for sale and no form on this site is active. If you are the original owner and would like this domain returned, please get in touch.