Stopping contact form spam
Practical ways to cut contact form spam using honeypots, simple challenges and filtering, without making life harder for real customers.
Put a contact form on the internet and within weeks it will start receiving offers for cheap search rankings, miracle supplements and messages in languages you do not speak. It is not personal. Automated programs crawl the web looking for forms and fill in every one they find.
The goal is to stop that rubbish without stopping customers. Those two aims pull against each other, and a lot of anti spam setups get the balance wrong. A form that blocks every bot and also loses one real enquiry a week is a bad trade for a plumber who lives on enquiries.
Know what you are dealing with
There are two kinds of form spam, and they need different handling.
Bots. Software that finds forms and submits them automatically, thousands at a time. This is the bulk of it. Bots are dim and predictable, which makes them fairly easy to catch without bothering anyone.
People. Real humans, paid or otherwise, typing sales pitches into your form by hand. No technical test will stop them, because they are exactly the kind of visitor the form was built for. You deal with these by filtering after the fact.
Most of the improvement comes from handling the bots quietly.
Honeypots: the invisible trap
A honeypot is our favourite first line of defence, because real visitors never know it exists.
The form includes an extra field that is hidden from people. A human never sees it, so they leave it empty. A bot reads the page's underlying code, sees a field, and fills it in, as bots do. Any submission with something in that field is discarded.
A related trick is a time check. A person takes at least several seconds to type a name, an email address and a message. A bot submits the form in a fraction of a second. Submissions that arrive impossibly fast can be thrown out.
Neither method asks anything of your customers. No puzzles, no ticking boxes, no squinting at blurry letters. They will not stop every bot, but they remove a large share of the junk at zero cost to real people.
Simple challenges, used with care
If honeypots are not enough, the next step is to ask the visitor to prove they are human. There is a range, from gentle to irritating.
- Invisible checks. Services such as Google's reCAPTCHA and similar tools can assess visitors in the background and only show a challenge when something looks suspicious. Most people never see anything.
- A tick box. "I am not a robot." Mildly annoying, quick.
- A simple question. "What is three plus four?" Easy for people, and it defeats basic bots. Make sure it is clear and works for visitors using a screen reader.
- Picture puzzles. Select all the squares containing traffic lights. Effective, and widely disliked.
Every step up that list costs you some real enquiries. People on phones, older customers, people in a hurry and people with vision or motor difficulties are the most likely to give up.
Our rule is to use the lightest method that solves the problem. Start invisible. Only add visible challenges if spam is still heavy, and never use the picture puzzles on a simple enquiry form unless you are truly under siege.
Filtering what gets through
Some spam will always arrive, especially the hand typed kind. Filtering deals with it after submission.
- Content filtering. Rules or spam filtering services that examine the message for the usual signs: several links, known spam phrases, text in an unexpected alphabet, a suspicious sender address.
- Blocking links. Genuine enquiries to a dog groomer almost never contain a web link. Rejecting or flagging messages with links catches a great deal.
- A quarantine, not a bin. This matters most. Suspected spam should go to a holding area you can check, not be deleted outright.
No filter is perfect, and the dangerous failure is a real enquiry classed as spam. If messages are destroyed on suspicion, you will never know what you lost. If they are held, a quick skim once a week rescues the rare mistake.
Small form design choices that help
A few details reduce spam and improve the form for customers as well.
- Keep your email address off the page as plain text. Addresses published openly are harvested and spammed directly, bypassing the form altogether. Use the form, or have the address displayed in a way that is harder to harvest.
- Ask for less. Name, contact detail, message. Short forms get more real enquiries, and there is less for anyone to abuse.
- Store submissions as well as emailing them. If a notification email is caught by your own inbox's spam filter, there is still a copy on the website to check.
What we would set up
For a typical small business enquiry form, in this order:
- A honeypot field and a time check.
- A spam filter on the message content, with suspect messages held, not deleted.
- A rule that flags messages containing links.
- An invisible background check only if the first three are not enough.
- A visible challenge as a last resort.
Then send a test enquiry of your own every month. Anti spam settings are a common reason forms quietly stop delivering, and the only way to know yours still works for real people is to be one.
A trickle of spam getting through is fine. Losing a paying customer to an overzealous filter is not. When in doubt, lean towards letting messages in.