Aeonity Blog
Sponsored links
Help Topics

How to Help Stop Spam Bloggers

You can stop comment spam via two approaches. The first tackles the problem before the comment is posted; the second addresses spamming after the fact.

1. Differentiate Between Spammers and Regular Users

Differentiating between spammers and regular users involves requiring your human posters to identify themselves as such though an extra step inserted in the commenting process. This is possibly the most widely used approach to avoiding comment spam, and includes two options.

The Turing Test

The most commonly used Turing Test (named after a computer scientist Alan Turing) is called CAPTCHA (Completely Automated Public Turing Test to Tell Computers and Humans Apart).

It involves adding to your site's comments area an image that contains a random piece of text. The text must be somewhat tarnished or blurred so that a human can read it, but a computer cannot. The commenter is asked to copy this text exactly into a form field before they submit the form.

This process makes it easy to guarantee that the commenter is a person, not a bot. It does not solve the problem of a human being spamming your comments section manually. However, as most spamming is carried out automatically by bots, this technique should stop most comment spam.


Constant updating of your code is not necessary, as this technique is not code-reliant.


Users are forced to perform an extra step, which does not benefit them, in order to submit their comments. This can be a serious downfall if your Website is just starting out and you're trying to encourage people to comment.

More information on CAPTCHAS can be found at A free resource that explains how to use CAPTCHAS on your site is available at Human Verify.

User Authentication

Using this method, the site owner requires all users to set up a username and password before they can comment on the site. If the administrator then finds a user spamming the site, he or she can ban that username or email address.

This approach works in two ways. Firstly, spammers don't want to be identified and therefore will be unlikely to sign up. But, even if they do, the hurdle of having to take the time to sign up in order to spam (and be banned immediately) can be a strong deterrent. After all, there are many, easier targets online than a site that has a user authentication system in place.


Though code-driven, this solution involves a database of users and simplified user management, so it's not too time-consuming. The banning of offending usernames may take some time, however.


Before they can post, users are forced to perform numerous extra steps, for which they may see little benefit. This can be a serious downfall if your site is just starting out and you are trying to encourage usage.

One way to make the system run a little more smoothly may be to use cookies to automatically sign in repeat users each time they visit the site. This way, when they go to post, they need not be faced with the login form: they're already logged in and can just start to post. This option doesn't alleviate the initial signup process, however.

More information on creating a user authentication system can be found at Developer Fusion, and, of course, through a search here at

2. Catch Comment Spam After it has Been Added

Catching comment spam will be necessary if you decide not to differentiate between spammers and human users. It may also be necessary if you have taken the steps above some comment spam is almost inevitable.

This approach involves the creation of a check that occurs after the comment is submitted to identify it is spam or a legitimate post. Of course, you can go through posts manually before they're made live, checking to ensure they're not spam. But you can also automate the process: create a list of keywords that are common to spam, and check each post against this list. You can then weed out any comments that contain the offending words (which might include terms like Viagra, gambling, poker, meds, etc.).

This comparison can be done in various ways, and at a number of points during comment processing. Most programming languages make it very easy to check a string for given keywords. Make sure that the string's case is also compared, by converting the string to lowercase or uppercase, before you run the comparison. If the comment is found to contain the key words, the spammer can be warned, and the comment deleted.


This approach does not require the commenter to take any extra steps, so the comments section remains simple and easy to use.


As the spammer changes the words used by the spam bot, your keyword list must also be updated. This technique will also be difficult to implement if the spammer advertises products that are relevant to your Website, your list of banned words might stop legitimate comments from being posted.

Managing Comment Spam Spam will always be a problem. However, a well-designed site that has taken into consideration the common spamming techniques will be able to avoid most spam. The techniques we've explored here should help site owners effectively to battle comment spam.

Ultimately, the Webmaster needs to adapt his/her techniques to deal with spam on an ongoing basis. The secret to success, then, is continual monitoring and adaptation to spammer's changing tactics.

By Sitepoint

Did this help you?
Click no to contact Aeonity.
Great! Click yes to go back the help section.