Contact form spam: stopping bot junk without losing real enquiries
Why your inbox fills with fake enquiries, how honeypots and CAPTCHAs filter it, and the honest limits of each layer.
Publish a contact form and the junk follows: fake enquiries, links to shady sites, and messages no human ever typed. This is not people finding your site and being odd. It is automated traffic. Cloudflare's glossary notes that more than half of internet traffic is bots, and lists spam content and email address harvesting among the activities of malicious bots. The good news: form spam is one of the cheaper problems to reduce, as long as you treat every defense as a filter rather than a wall.
Why it keeps coming
Spam bots are built to fill forms. A developer write-up of the honeypot technique describes comment spam bots trying to fill every field they encounter while largely ignoring CSS. Your contact form is a target simply because it exists and accepts text.
Blocking by IP address alone has limits too. Cloudflare's bot glossary explains that bad bots may run as botnets - copies of the bot on many devices - so the traffic arrives from many different IP addresses, which makes the source harder to identify and block. This is why the workable defenses look at what a submission does, not just where it came from.
Layer one: the honeypot field
The honeypot is the cheapest filter and asks nothing of your visitors. The technique: add an extra form field, hide it from people with CSS, and reject any submission where the field is filled in. Humans never see it, so they leave it blank; bots that fill every field fall into the trap. The original write-up also suggests naming fields deceptively - the visible message box gets an unexpected name while the honeypot takes a tempting name like "body" - so the bot's fill-everything habit works against it.
Two practical details come from current honeypot guidance rather than the 2007 original: hide the field with display:none, since merely moving it off-screen can leave it available to screen readers and autofill, and add autocomplete="off" and tabindex="-1" as best-effort hints so browsers skip it - support varies by browser, and autofill completing a honeypot is a documented cause of real users being blocked. The check itself happens on your server when the submission is processed, never in the browser.
Done that way, this catches the simple bots and adds little visible friction for real visitors - though no hidden trap is perfect, which is why the false-positive caveats above matter. It will not catch a bot configured to skip hidden fields, so treat it as the first filter, not the whole answer.
Layer two: challenges, in order of friction
When honeypots are not enough, the CAPTCHA family adds a human check. Cloudflare's guide to how CAPTCHAs work describes three approaches, and the order matters for your visitors:
- No-interaction behavior assessment: the system judges likely humanity from signals like cursor movement, cookies and device history, with no user action at all.
- The checkbox: clicking "I'm not a robot" is not itself the test - Cloudflare explains the test is in the behavior leading up to the click, with an extra challenge only if the signals are inconclusive.
- Image recognition: picking the squares with street signs. Effective, but the most annoying, and worth saving for when the quieter options are not holding.
The practical rule: start with the least intrusive option that reduces your junk, and only add friction when you can see the junk getting through.
Layer three: invisible and managed options
Newer tools drop the challenge entirely for most visitors. Cloudflare offers Turnstile, described in its CAPTCHA guide as an invisible alternative available as a free code snippet to anyone, Cloudflare customer or not. At the larger end, Cloudflare's bot glossary describes bot management products that use machine learning and behavioral analysis to separate harmful bots from both humans and helpful bots like search crawlers, aiming to block malicious behavior without affecting user experience. For a small business form, the free invisible tier is usually the right stopping point.
Whichever challenge you pick, the verdict must happen on your server. Cloudflare's Turnstile documentation is blunt: the client-side widget alone does not protect your forms, because tokens can be forged, so your server must validate each token through the Siteverify API - tokens expire after 300 seconds and are single-use. If your form tool only embeds the widget and never checks the result server-side, a bot can skip the challenge entirely by posting to your form directly.
Be honest about the limit
No challenge is a wall. Cloudflare's own CAPTCHA guide notes that some bots get past text CAPTCHAs on their own, researchers have beaten image-recognition tests, and attackers can use click farms - thousands of low-paid workers solving CAPTCHAs on behalf of bots. The same guide says other strategies need to be in place besides a CAPTCHA for stopping unwanted bots. So set the right expectation: each layer reduces volume and raises the attacker's cost. A realistic goal is a mostly clean inbox, not a mathematically pure one.
What to do this week
- Add a honeypot field if your form or form plugin supports it - many do, and it costs your visitors nothing. Check it uses display:none and autocomplete="off" so real visitors and their autofill never touch it.
- If junk still gets through, add an invisible or checkbox challenge rather than jumping straight to image puzzles.
- Watch what still arrives for a couple of weeks before adding anything heavier.
- Keep the form itself short; every field you remove is one less thing for a bot to fill and one less hurdle for a real customer.
Form spam is an annoyance, not an emergency. A honeypot plus one quiet challenge handles most of it, and knowing the limits keeps you from over-fortifying the front door while real customers are trying to knock.
Sources: Cloudflare's "What is a bot?" and "How CAPTCHAs work" learning pages (bot traffic share, botnets, CAPTCHA approaches and their limits, Turnstile, bot management), Cloudflare's Turnstile server-side validation documentation (the widget alone does not protect forms; Siteverify, 300-second single-use tokens), Phil Haack's original honeypot technique write-up (bots filling every field), and current honeypot implementation guidance from CSS-Tricks (display:none, autocomplete="off", tabindex="-1") with documented autofill false positives.
Frequently asked questions
Will a CAPTCHA stop all contact form spam?
No. Cloudflare's CAPTCHA guide notes that some bots defeat text CAPTCHAs, researchers have beaten image-recognition tests, and click farms pay humans to solve challenges for bots. A CAPTCHA cuts volume and raises the attacker's cost; it does not produce a perfectly clean inbox.
Does a honeypot field bother real visitors?
Done properly, no: the field is hidden with display:none and marked autocomplete="off", so people never see it, screen readers skip it, and browser autofill does not fill it in - autofill filling a badly built honeypot is a documented cause of false blocks. A filled honeypot field then becomes a reliable spam signal, checked on the server.
Can I just block the IP addresses the spam comes from?
It rarely holds on its own. Cloudflare's bot glossary explains that bad bots may run as botnets across many devices, so the traffic arrives from many different IP addresses. Defenses that look at submission behavior, like honeypots and behavior checks, cope with that better.
Is form spam a security risk or just an annoyance?
Mostly an annoyance, but Cloudflare's bot glossary lists email address harvesting among malicious bot activities, and junk messages can carry phishing links. Filtering them protects your time and reduces what reaches your inbox.