Using Ajax to reduce comment spam

March 1st, 2007

If you are building a custom web application like a social network website or a blog software, you probably want to enable every visitor to enter comments. This makes sense, since these comments generate free content for your new website. Of course these comment-forms have always been abused by web-spammers, that use guestbooks or blog’s comment-forms to promote their URLs. One way to fight this spam is using CAPTCHA images.

Another way, that might be a lot easier for the user, is AJAX. Just ajax your comment form and you make it a lot harder for automated spam-bots to “comment” on your website. AJAX comment forms are basically just very few lines of Javascript-code in the HTML source of your pages. The form itself is loaded and generated into the page by this Javascript. Of course this is not a 100% proof weapon against comment spam, but especially if you design a custom application this should reduce spam immediatly. I doubt that spam-bots are clever enough to dig through your custom Javascript-Code or know about the code used by existing AJAX-frameworks and figure out what parameters to send to which URL to generate a spammy entry.

There are a lot of free Ajax-Frameworks, that help you with building ajaxed forms. They can be integrated nicely in your web application.

Leave a Reply