Spam prevention techniques


January 15th, 2010

On my various websites I get hundreds of Spam messages every day; it gets very annoying! I’ve tried several methods and in this post I will outline three. Soemtimes they works, sometimes they don’t. Some are more effective than others.

CAPTCHAs

CAPTCHAs (Completely Automated Public Turing test to tell Computers and Humans Apart) are a random strings of text and numbers that a user must enter to be classed as non-spam. The letters and numbers are displayed as an image and usually over a pattern and are distorted to prevent bots from easily reading them.

Pros: Skewed text against noisy background can be hard for Spam bots to read
Cons: Can be difficult for humans to read, spam bots are getting better at recognising them

Hidden text fields

Create a text field in your form and hide it via your CSS (using display: none). When processing the form if the field has been filled out it is Spam.

Pros: Filters out around 75% of spam bots
Cons: Some bots check your CSS, those with CSS disabled still see the text field

Ask a question

Ask a question that doesn’t have the answer in the question. A popular one could be a maths question (e.g. what is 1 + 5). Even more effective would be What colour is the sky?

Pros: Filters out 99% of spam
Cons: Some foriegn users or those who struggle with spelling may get the answer wrong

Leave a Reply

You must be logged in to post a comment. If you don't have an account register one now.