Spam protection
Honeypot field
A honeypot field is a form input hidden from people but visible to bots. Real visitors leave it empty, so any value in it marks the submission as spam.
Also called: honeypot, honeypot input, honeypot technique
Most form spam does not come from a person typing into your page. It comes from scripts that find a form, fill in every field they can see in the HTML and post it. A honeypot field turns that habit against them: it adds one extra input that a person cannot see, so a person never fills it in, and a script that fills in everything does.
How it works
You add a text input to the form and hide it from visitors. When the form is submitted, the server checks that input. An empty value means a person (or a well-behaved script). Any value means the submission is almost certainly automated.
The check costs the visitor nothing. There is no puzzle to solve and no extra script to load, which is why honeypots are the usual first layer of form spam protection.
Hide it the right way
Hide the field so that people, keyboard users and screen readers all skip it, but bots that read the HTML still find it:
<div style="display: none;" aria-hidden="true">
<input type="text" name="website_url" tabindex="-1" autocomplete="off" />
</div>
display: none(or moving the field off screen) keeps it out of sight.aria-hidden="true"andtabindex="-1"keep screen readers and the Tab key away from it.autocomplete="off"stops browsers from filling it in for a real visitor.
Choose a believable name
A bot decides what to fill in from the field name. A name like website_url looks like something worth filling, so it works better than honeypot or do_not_fill. Avoid names that browsers and password managers fill automatically, such as email, phone or address, because those can flag a genuine visitor as a bot.
Where honeypots fall short
A honeypot only catches scripts that fill in fields blindly. A bot that renders the page like a browser, or a person sending spam by hand, will leave the field empty. That is why a honeypot works best next to other layers such as a CAPTCHA and bot detection rather than on its own.
In StaticForm
Turn on the honeypot in the form’s spam settings and pick the field name (the default is website_url). Add the hidden input to your HTML. If the field arrives with a value, StaticForm flags the submission as spam: it is stored in the spam list, and your email notifications and webhooks are skipped. The honeypot value is never sent to the optional AI review.
Learn more
Related terms
- Bot detectionBot detection is the set of checks that tell automated form submissions from real visitors, using signals such as request headers, IP reputation, honeypots and message content.
- CAPTCHAA CAPTCHA is a challenge that separates people from automated scripts, used to stop bots from submitting forms, creating accounts or scraping a site.
- Form validationForm validation is checking that the data a visitor submits is complete and in the right format, before it is accepted, stored or acted on.