As a company that builds web portals and corporate sites we noticed a spam problem with web forms. Our clients complained about spam coming through their contact forms (or they receive blank forms) and requested that we solves it.
Why CAPTCHA is not the solution?
Captcha is not always a good option. Visitors hate to fill it in and if those visitors are your potential customers you do not want them to feel frustrated as it is going to kill your conversion. Here is just one of many articles on this (https://www.seomoz.org/blog/captchas-affect-on-conversion-rates)
Akismet (www.akismet.com) is better choice but it is commercial product which starts from 50$ per month (unless for personal use). Even then, or you have only personal site, note that Akismet is designed mostly for blog *comments*. Connecting it to contact forms or similar web forms is not so efficient as those forms usually consist of quite a few inputs and not just long comments.
Solution
That’s why we decided to go the other way, to implement antispam technique that does not affect conversion as it is completely invisible to visitors. Those techniques are not invented by us, they are known and used over the net (like visual hiding a field on a form; spambots still see it in the source code and fill it in which triggers spam flag). We took several of those techniques (read more about them below) and implemented as modules we use on day to day bases on sites we develop. We are using ASP classic version, .NET version, DotNetNuke module and Umbraco package.
Small bonus for Umbraco users
Since Mailform Protector sends out email it is basically also classic form2mail component! Design any form in HTML, with no limitations of “form builders” used out there, just connect it to Mailform Protector and your form is going to be mailed to you when somebody fills it in. This way, when building a form, your only limitation is in HTML/CSS. Build whatever you want, use JQuery or not, group items with DIVs or SPANs, use images, put two or even more different forms on the same page – it doesn’t matter. What form builder can offer that flexibility?
This is also result of us being in business of building websites for over 10 years. We believe that for any webmaster, there is no better tool to design a web form than using HTML itself and tools like Dreamweaver or notepad or whatever HTML editor you prefer. Form generators are for your non-technical clients, but if your job is to create a form then form generator is just not flexible enough. Just do whatever you do every day in your favourite HTML editor, copy/paste in Umbraco content or template, link it to Mailform protector and you’re done!
Architecture
Mailform protector package contains two ASP.NET user controls:
AntispamControlFields is a very simple web control that should be placed inside <form> tags. It inserts three hidden input fields in the html form. AntispamValidator web control performs all antispam checks and therefore should be located on the destination page (page that receives the form post). When the form containing AntispamControlFields is posted, on target page Antispam control awaits for posted data, checks those 3 fields and uses other antispam techniques described above to build up a total spam-score. Based on result, configured action is taken (email form data, redirect to another page).
Sometimes form is pasted to the same page (itself). That is why we decided to include AntispamControlFields control inside AntispamValidator control. So, for implementations like this there is no need to use AntispamControlFields control – AntispamValidator control will do that job by itself. This control doesn’t use PostBack so there is no need to place it on the form with attribute runat=“server“. Any form will do. In fact, multiple forms on the same page will work!
Antispam techniques used
Installation
Mailform Protector is installed just like any other standard Umbraco module, as a package through Umbraco back office.
Requirements
Mailform Protector is tested on Umbraco 4.x but we don’t see any reason for it not to work on earlier versions of Umbraco as it is stand-alone .NET control that does not use any of Umbraco APIs.
So far this was commercial Umbraco component that we implement in Umbraco projects.
Now we decided to give it free for any use and on AS-IS basis. Component comes with documentation and without source code included.
If you need assistance in implementation, implementation or any other modification let us know.
Also published on Medium.