Web Development for 2010

Alexander Dickson - Web Developer covering PHP, jQuery / Javascript, XHTML, CSS, more

Take the power back (from spammers)

Published on Saturday, 26th September 2009.

I thought I could do it. I thought I could forego a CAPTCHA, and everything would be fine. I had Akismet after all, I'm safe.

Well, turns out I'm not. I've received about 25 spam comments to my blog, which would of made up about 90% of total comments. Oh dear. At least I got to quote a great Rage Against The Machine track.

The spam is getting clever. I have to read it twice to understand that it's even spam. My first one read something like:

Excellent post. I agree. Some obscure links here.

I nearly fell for such a generic comment, and it wasn't until I saw the links that I had to assume it was comment spam. I am sick of deciding what is spam or not (and I may have had some false positives), so I am crushing under the pressure and using a CAPTCHA.

I'm going to try and use the Honeypot style of CAPTCHA. I like it for the following reasons:

  • It's unobtrusive to CSS enabled users (should be 100% of my users according to Google Analytics)
  • If you do have CSS disabled, all you need to do is follow the dead simple instructions (don't fill out this field!).

Basically, I'm going to have an input with a name attribute like location (something tempting to fill out), and I'm going to silently fail every request which has it filled out. In the HTML, I'll have a label that says something to the effect of leave blank!

Now all these, of course, relies on no super bot accessing this post, parsing into a SuperParser™, figuring out my anti spam method and automatically adapting itself. :P

Comments

Leave a Comment

Comment Details

Your email will never be displayed. If you have a gravatar, it will be displayed.

Note: Your comment may require approval before it is posted to the site.

Stack Overflow Profile

view full profile »

About

I'm a web developer from the Sunshine Coast, Australia. more »