Honeypot Form Field Generator
Generate HTML+CSS snippets for an anti-spam honeypot field (input invisible to bots, accessible to humans) with optional timestamp.
Honeypot form fields: invisible spam filtering
A honeypot is a form field that no human ever sees but most spam bots happily fill in. The trick exploits a behavioural gap: simple bots scan the HTML and dump text into every <input> they find, especially fields with familiar names like website, url, phone2 or email_address. A real user, who relies on the rendered DOM, never touches the hidden field โ so if the server receives a non-empty value, it can safely discard the submission as a bot.
A robust honeypot in HTML
Hiding the field is delicate. display:none and visibility:hidden are too obvious โ modern bots check both before filling. The most effective recipe is to render the field off-screen but still in the layout, and to remove it from keyboard navigation:
<input type="text" name="website" tabindex="-1"
autocomplete="off" aria-hidden="true"
style="position:absolute;left:-9999px;
width:1px;height:1px;opacity:0;">
On the server, the check is a single line: if request.body.website is non-empty, reject as spam. Pair it with a time-based check: store the render timestamp in a hidden field and reject submissions that arrive in under 3 seconds โ humans simply do not type that fast.
Pros and cons
- Pro: invisible to users โ zero friction, unlike CAPTCHA puzzles or "I'm not a robot" checkboxes.
- Pro: free, no third-party calls, no privacy leak, no CSP allowance needed.
- Con: smart bots (Playwright, Puppeteer with humanized behaviour) read the rendered CSS and know to skip the field.
- Con: some screen readers may still announce the field โ always pair with
aria-hidden="true"andtabindex="-1". - Pitfall: never name the trap field
password,emailornameโ the browser's autofill will write into it for a real user and trigger a false positive.
Defence in depth
Honeypots are one layer, not a silver bullet. Production-grade anti-spam stacks combine:
- Honeypot + time-trap (catches dumb bots, ~90% of spam volume)
- Rate limiting per IP / per session (catches bursts)
- CSRF tokens (block cross-site replays)
- Cloudflare Turnstile or hCaptcha invisible for high-risk forms โ modern alternatives to reCAPTCHA without picture puzzles
- Content scoring (Akismet for WordPress comments, custom Bayesian for others)
Where it ships in the real world
WordPress comment forms include honeypot logic via plugins like Antispam Bee and WPBruiser; the popular Contact Form 7 plugin has a built-in honeypot add-on. The CodeIgniter PHP framework documents a honeypot security helper. The 2024-2025 trend is to pair a honeypot with Cloudflare Turnstile, giving an effectively invisible CAPTCHA that catches the bots a honeypot misses, without ever asking the user to identify traffic lights.
FAQ
Can advanced bots see the honeypot? Yes โ headless browsers driven by Playwright or Puppeteer can read the computed style and skip the trap. That is why you combine honeypot with timestamp checks and a real CAPTCHA on high-value forms.
Should I combine with reCAPTCHA? Honeypot first (catches the loud, cheap traffic) and an invisible CAPTCHA second (Turnstile or reCAPTCHA v3) is the recommended stack. Honeypot alone is enough for low-risk forms like newsletter signups.
Does it hurt accessibility? It can, if you forget aria-hidden="true". Some screen readers will read out an off-screen input and confuse the user. Always add ARIA attributes and a tabindex="-1".
What about math-problem honeypots ("What is 2+3?")? They catch many bots but they are CAPTCHAs in disguise and add friction. Worse, they are an accessibility nightmare for users with dyscalculia. Prefer the invisible-field approach.
Related Tools
Handwriting Generator
Convert typed text into an image with handwriting appearance. Useful for adding a personal touch to digital work.
Resume Generator
Fill a simple printable A4 CV from a form with personal data, education and experience.
Favicon Generator
Generate a favicon from text/emoji in all common sizes (16, 32, 48, 64, 192, 512). PNG download.