Two things go wrong with contact forms, and they pull in opposite directions. Either the form fills with junk, or the defences against junk quietly block real customers. The second is far more expensive and far harder to notice.
Start by making sure it works at all
Before anything else, confirm messages arrive. The most common form failure is not spam. It is a form that has silently stopped delivering, usually because an email provider started rejecting mail sent from the website’s server.
- Submit a real test, monthly. Put it in a calendar.
- Store submissions somewhere as well as emailing them. A database row or a spreadsheet means nothing is lost when mail fails.
- Send from a proper service, not the web server, with SPF and DKIM set up for your domain.
- Add an autoresponder. If the customer gets a confirmation and you get nothing, you know immediately.
The defences worth having
1. A honeypot field
A field hidden from people but visible to bots. Real visitors never fill it, automated scripts fill everything. If it has content, discard silently.
Costs nothing, blocks a surprising share of junk, and no customer ever notices it. Start here.
2. A timing check
Most people take more than three seconds to complete a form. Most bots take under one. Record when the form was rendered and reject submissions that arrive implausibly fast.
3. Rate limiting
One IP submitting forty times an hour is not a customer. Limit by address at the edge, which on Cloudflare is a rule rather than code.
4. Required detail
A phone number field, or a question that needs a real answer such as “what are you trying to build”. Generic spam cannot fill those plausibly, and it improves the quality of genuine enquiries too.
5. Invisible challenges, last
Cloudflare Turnstile or reCAPTCHA v3 run without the visitor doing anything. Reach for these when the simpler layers are not enough, not first.
What to avoid
Visible CAPTCHAs. The traffic light grids are hostile. They fail people with low vision, they fail on bad connections, and they lose real enquiries. The lost customers are invisible, which is exactly why this gets kept.
Blocking by country. Tempting, and it will block real people. Expats, travellers, and anyone on a VPN.
Long forms as a filter. Making someone answer eleven questions does reduce spam. It reduces enquiries more.
Where the real cost is
A junk email takes two seconds to delete. A lost enquiry can be worth thousands. Any defence should be judged on that asymmetry, and it argues for the quiet measures over the loud ones.
If you are getting a handful of spam a week, that may simply be the correct amount to tolerate.
If you are not sure your form is delivering, send us the URL and we will test it as part of a free audit.