If you have a forum or blog on your Web site you may have noticed that some of the messages left in the comment area may not necessarily be relevant to the discussion and instead be promoting such Internet staples as Viagra and Prozac or nude pictures of celebrities. If you can relate, you've probably been hit with comment spam.
Let Rackspace make the difference with reliable managed hosting solutions backed by Fanatical Support.™ 100% Network Uptime Money-Back Guar., 1-hour hardware replacement, 24/7 LIVE, MS and LNX certified technical support.
Although people typically associate spam with their email inboxes, comment spam has become more prevalent with the growing popularity of blogs. There are a few things you can do to prevent spammers from getting to be too much of a nuisance.
Banning specific IP addresses isn't as useful as you may think. Although this may seem like a logical thing to do, most comment spammers bounce requests off other computers and servers, making it almost impossible to completely eliminate them from your Web site.
Something you should ban is HTML or JavaScript. Because a spammer's aim is to increase his, or his clients', ranking in search engines, he will often leave URLs as part of his comments. So disabling HTML or JavaScript is an effective preventative measure to take. If you feel you need to enable links though, the most common method is to inform the user that all URLs will be converted to links automatically, then convert any content that starts with http:// into a link.
Another code you can adjust if you enable HTML in your comment forms is to add rel="nofollow" to the spammer's tag, like this:
This will tell search engines bots to ignore the link, so the spammer gains no benefit from adding links to your comments.
One other thing to keep in mind is stay away from names that describe a form's fields because form element names like "comment" make it too easy for bots to find your comment systems.
There are also a couple of things you can do to stop spam entirely. You can tackle the problem before the comment is posted by authenticating a user's sentience by adding a CAPTCHA at the end of each comment submit form so that bot's can't spam you or you can require users to sign up for an account. You can also create a list of keywords that are common to spam and check each post against this list. This process can be automated and can weed out any comments that contain commonly-used terms like Viagra, gambling, poker or meds.