Comment Spam and WordPress

Sun Feb 12 21:25:28 2006 EST (-0500 GMT)

Want to leave a comment but can’t?

Send me a message via the via the “Send a Message ASAP” link found on my home page mattclare.ca.

I’ve had enough!

I’ve had enough of ‘bots posting spam as comments on my blog!

Today while trying to remove hundreds of items of comment spam I removed at least four comments I really wish I still had. Of course, it was to be a quick job and I didn’t do a backup before hand.

It’s not the first time either, I lost all the comments from the Billy Corgan and K-OS concerts because I mistakenly deleted them. Too much comment spam makes the comment section of a blog unreadable and blog comments are important. Blog comments are what keep people blogging about things they know nothing about in check! ….that and there’s a community aspect to it or something.

For those of you who don’t have a blog, especially a wordpress blog, you probably aren’t familiar with comment spam — though you may have seen it. Despite all the evidence to the contrary, most people who read blogs don’t leave comments about poker, debut consolidation, and pron. Many do leave comments about how much they like the blog, but they tend not leave links to poker, debut consolidation, and pron with those comments.

Where is this all coming from?

‘Bots are what all these comments about poker, debut consolidation, and pron are what are coming from. ‘Bot is short for robot. As I recently explained during an interview for a local paper about this blog, ‘bots are computers programmed to scower the internet for blogs and to post comments with links back to their sites. Comment spam is created to get the word out about their site and to increase the value Google assigns to it. The worst part is it’s very easy to create a ‘bot and one ‘bot can make hundreds of posts a second. Many viruses are designed to turn PCs into Spam ‘bots.

WordPress and other blogs and Wiki’s use blacklists to check against words that should not be posted but they only go so far. I find WordPress’ blacklist doesn’t work and the moderation list works, but the interface to reject comments that have been flagged and approve good comments is difficult to use when you’re trying to review hundreds of comments. This is how in the hundreds of spam comments you can mistakenly select a real comment and delete it.

What to do?

Obviously the best strategy is to be proactive and prevent spam comments. Some blog make users type in text from an image only a human could read – but only a fully-abled human, as they are not very accessible. I use a a plugin called Hashcash to ensure the comment page was at least loaded in a proper web browser, though some ‘bots are sophisticated enough to get around this.

If you have access to your MySQL database, either directly or through PHPMyAdmin you can run these SQL queries AFTER you make a backup/export of the database (or just the wp-comments table).

  • DELETE FROM `wp_comments` WHERE `comment_author` LIKE '%poker%';
  • DELETE FROM `wp_comments` WHERE `comment_author_url` LIKE '%poker%';
  • DELETE FROM `wp_comments` WHERE `comment_author` LIKE '%slots%';
  • DELETE FROM `wp_comments` WHERE `comment_author_url` LIKE '%slots%';
  • DELETE FROM `wp_comments` WHERE `comment_author` LIKE '%Texas%';
  • DELETE FROM `wp_comments` WHERE `comment_author_url` LIKE '%pill%';
  • DELETE FROM `wp_comments` WHERE `comment_author_url` LIKE '%roulette%';
  • DELETE FROM `wp_comments` WHERE `comment_author_url` LIKE '%casino%';
  • etc.

Wired Magazine’s Steven Johnson has an article on comment spam

UPDATE: I think this article has more spam than any other rite now 🙁 I have found that I can mass set old posts to close their comments with this SQL statement:

  • UPDATE `wp_posts` SET `comment_status` = 'closed' WHERE `post_date` LIKE '2005%'

Thanks to a handy WordPress plugin all posts are set to no longer accept comments after 60 days thanks to this plugin: codex.wordpress.org/Plugins/Auto_shutoff_comments.

Comments are closed.