Defend your blog from spam comments

Spam is a problem that plagues any resource on the Internet that allows any kind of user input. The unscrupulous denizens of the Web are constantly on the look out for more ways to include profitable URLs in accessible locations on the Net and as the awareness and popularity of blogging increases so does the allure of utilizing it for profit. In the blogging universe, this has largely meant comment spam. Comment spam is usually attached to older entries (in hope of escaping the notice of admins) and unrelated to the content of the entries to which they are attached. It’s annoying and a problem that will likely never end. Luckily there are more than a few ways to fend off the would-be exploiters in ways that will save you time and energy better spent adding content to your blog rather than weeding out the rotten apples. Here are five WordPress plugins that can help in this process:

1. Akismet. Akismet would be popular even if it wasn’t incredibly effective because Matt Mullenweg the head honcho of WP development is its creator. Luckily, it is as good as its reputation at dealing with comment spam. It works by comparing comments to a huge database of information about spammers already recorded and taking action against those comments when appropriate. Usually suspect comments are quarantined for a period of 15 days. What makes this tool especially valuable is that it is adaptive to prevent the poisoning of the database with false positives. If Akismet marks a legitimate comment as spam then not only can you transfer it out of the spam queue but it is also reported back to the database as a false positive. This one is included with every download of WordPress so all you really need to do to take advantage of it is to head over to to sign up for a user account, grab your API key, and activate the plugin in the WP dashboard.

2. Peter’s Custom Anti-Spam. This is a Captcha solution to the comment spam problem. Users are prompted to enter a word before they can successfully submit a comment. This is effective in combatting the use of automatic spam bots that try to leave as many comments as possible. This also allows you to granularly control how the plugin is doing its job by creating your own list of source words and selecting whether or not registered users will have to complete the Captcha in order to leave comments.

3. Bad Behavior. Bad Behavior takes a more radical approach to dealing with the problem of comment spam. It filters all requests to your site through a filter that looks at how people are accessing your website in addition to the comment they are trying to add. The advantage here is that BB can spare you the bandwidth costs associated with spam robots that tend to make numerous attempts simultaneously. This one is a little trickier to set up as it requires a little digging around to make sure everything is properly configured but there is no dearth of documentation to help you get Bad Behavior up and running.

4. Math Comment Spam Protection. In order to submit a comment users must solve a simple math problem. This works great for limited shared hosting because it doesn’t require any special software on your server and doesn’t require Javascript in the the browser. It has a number of options that you can configure through the administration dashboard and requires only a couple of lines pasted into the comments.php file of your theme. It’s simple, elegant, and effective.

5. DNS Anti Spam. DNS Anti Spam compares the IP address of the commenter against a huge blacklist of known spammers and checks to make sure that there are no links in comments that match that blacklist.

This list is a short list of recommendations so it is by no means definitive. One of the most frustrating aspects of dealing with comment spam is that the battlefield is constantly changing as spammers adapt to try to work around the tools we use to minimize their harm. Many of the tools referenced above use a centralized database to track results so if given an option always enable your tools to report back when you find false positives or negatives. It’s a very simple and low impact way of giving something back to the community.

Please follow and like us:
About shk

shk is a DevOps engineer with more than 12 years of experience in different organizations. He enthusiastic about learning new technologies and shares his knowledge through his blogs.


  1. Another one I find really helps is Spam Karma. Defending my blog against spam is (sadly) one of the first things I do when I create a new blog.

    I wish it wasn’t so, but until it’s no longer a challenge, I am glad there are plugin developers out there that offer solutions.

  2. searching for same blog engine

  3. now I among your readers

Comment Policy:

Your words are your own, so be nice and helpful if you can. Please, only use your real name, not your business name or keywords. Using business name or keywords instead of your real name will lead to the comment being deleted. Anonymous commenting is not allowed either. Limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.

Tell us what you're thinking...

All comments are moderated.

* Denotes required field.



Previous Post:
Next Post: