CAPTCHA Form Spam Bot Protection

Honeypot CAPTCHA: How It Works and When It Is Enough

A honeypot CAPTCHA is a hidden form field that only bots fill in. How to add one, what it stops, how it compares with reCAPTCHA, and when it is enough.

Published Dec 27, 2025 · 9 min read · Updated Oct 08, 2026

Key takeaways

A hidden field that only bots fill in
A honeypot CAPTCHA adds a form field that people never see. A bot that fills in every field also fills in this one, and your server rejects the submission without the visitor solving anything.
Often enough for a small contact form
On a contact or comment form that only gets generic spam, a honeypot catches much of it. It costs nothing, sends no data to anyone and sets no cookies.
Blind to bots that render the page
Bots that run a real browser see what visitors see and skip the hidden field, and bots written for your site leave it out. Logins, signups and checkouts need more than a honeypot.
reCAPTCHA catches more, at a cost
reCAPTCHA also targets automated browsers, but it sends visitor data to Google, sets a cookie and shows v2 visitors image puzzles when it is unsure. An invisible CAPTCHA with proof-of-work sits between the two.
On this page
  1. What is a honeypot CAPTCHA?
  2. How a honeypot field works
  3. How to add a honeypot to your form
  4. What a honeypot stops, and what it misses
  5. Honeypot vs reCAPTCHA
  6. Can a honeypot block real visitors?
  7. When is a honeypot enough?
  8. Where TrustCaptcha fits
  9. Try TrustCaptcha
Share this post

What is a honeypot CAPTCHA?

A honeypot CAPTCHA is a form field that people never see but bots do. A spam bot that fills in every field it finds also fills in the hidden one, and your server rejects the submission. The visitor solves nothing and notices nothing.

The name comes from security, where a honeypot is a decoy that lures attackers the way honey lures flies. Strictly speaking it is not a CAPTCHA, because nobody is tested: the trap is set for the bot, and a person never touches it. People call it one because it does the same job on a form.

A form with a hidden honeypot field between the email and message fields: a visitor does not see the field and leaves it empty, so the form is accepted; a bot fills in every field including the hidden one, so the form is rejected

How a honeypot field works

  1. You add an extra input to the form, for example a field named website.
  2. You hide it with CSS, so it is not on screen. A visitor never sees it and leaves it empty.
  3. A bot that reads the HTML and fills in every input fills in this one too.
  4. Your server checks the field. If it has a value, the submission is spam, and you reject it or drop it quietly.

The check has to run on the server. A honeypot that is only checked in JavaScript does nothing against a bot that posts the form directly.

A common addition is a second trap: time. A person needs a while to read and fill in a form, a script needs a fraction of a second. If a submission arrives faster than anyone could type it, treat it as automated.

How to add a honeypot to your form

You need three pieces: the field, the CSS that hides it, and the check on your server.

The field
HTML
<div class="hp-field" aria-hidden="true">
  <label for="website">Leave this field empty</label>
  <input type="text" id="website" name="website" tabindex="-1" autocomplete="off">
</div>
Hide it
CSS
.hp-field {
  position: absolute;
  left: -9999px;
}
Check it on the server
PHP
// Reject the submission if the hidden field is missing or filled in
if (!isset($_POST['website']) || $_POST['website'] !== '') {
    http_response_code(400);
    exit;
}

A few details decide whether it works:

  • Hide the field with a class in your stylesheet, not with type="hidden" or an inline style. Many bots skip hidden inputs, and some read inline styles.
  • aria-hidden="true" and tabindex="-1" keep screen reader and keyboard users out of the field, and the label tells anyone who reaches it to leave it empty.
  • autocomplete="off" and a name that does not look like an address or email field make it less likely that browser autofill fills it in.
  • Check that the field is present and empty. Otherwise a bot that posts straight to your endpoint without the field passes.
  • Do not tell the bot why it failed. A generic error, or a normal thank-you page, gives a bot author nothing to tune against.

Some form plugins and frameworks have a honeypot option built in, so check yours before you write one.

What a honeypot stops, and what it misses

A honeypot is good at one thing: generic spam bots that crawl the web for forms and fill in every field they find. They send much of the junk that reaches contact forms and comment sections, and the honeypot catches them at no cost.

It misses three kinds of attacker:

  • Bots that run a real browser. A headless browser renders the CSS, sees that the field is off screen and leaves it alone.
  • Bots written for your site. Someone who looks at your form once will see the trap and leave the field out.
  • People. Paid spammers and CAPTCHA farms fill in what a person sees, and a person does not see the honeypot.

It also does nothing against attacks that send exactly the fields a real user would. Credential stuffing on a login form, fake signups and bots testing stolen cards fall into that group. For those you need rate limits, proof-of-work or a bot score. Our page on CAPTCHA alternatives shows how those methods fit together.

Honeypot vs reCAPTCHA

A honeypot is free, invisible and private, and it only catches careless bots. reCAPTCHA catches more, including many bots in real browsers, but Google receives data about your visitors, a cookie is set, and reCAPTCHA v2 shows image puzzles when it is unsure. Which one fits depends on what is attacking your form.

Honeypot field and Google reCAPTCHA compared
Honeypot fieldGoogle reCAPTCHA
What the visitor doesNothingv2: a checkbox, and images when unsure; v3: nothing
What it stopsBots that fill in every fieldSimple bots, plus automated browsers that Google's risk analysis flags
What it missesBots that render the page or were built for your siteBots that pass as human, and people paid to solve challenges
What your server getsA field that is empty or filled inv2: pass or fail; v3: a score from 0.0 to 1.0, default threshold 0.5
Data sent to a third partyNoneVisitor data goes to Google; location varies, needs a legal review
CookiesNone_GRECAPTCHA, which Google calls necessary
CostFreeFree up to 10,000 assessments a month per organization, then an $8 flat fee up to 100,000
Who maintains itYouGoogle
Honeypot vs reCAPTCHA: both stop simple bots that fill every field, only reCAPTCHA partly stops bots in a real browser, neither stops people paid to solve CAPTCHAs; the honeypot costs visitors nothing, sends no data and sets no cookies, while reCAPTCHA can show images, sends data to Google and sets the _GRECAPTCHA cookie

Use a honeypot on its own when the form is low value and the spam is generic. Use a CAPTCHA when bots keep coming after you added the honeypot, or when the form protects something worth attacking: a login, a signup, a checkout. The two also work well together. The honeypot catches the cheap bots, and the CAPTCHA only has to deal with the rest.

If Google is the reason you are reading about honeypots, there is a middle option. An invisible CAPTCHA with proof-of-work catches bots that render the page without showing visitors a puzzle, and some providers process data in the EU and set no cookies. Our list of reCAPTCHA alternatives compares seven of them, and Is reCAPTCHA GDPR compliant? covers the privacy side.

Can a honeypot block real visitors?

Yes, if it is built carelessly. Three things tend to go wrong:

  • Autofill. Browsers and password managers fill in fields they recognize. A honeypot named email2 or phone may get filled in for a real visitor, who is then rejected without knowing why.
  • Screen readers. A field that is only hidden visually can still be announced, and a blind visitor may fill it in because the form seems to ask for it. aria-hidden="true" on the wrapper and a label that says “leave this field empty” prevent that.
  • Keyboard navigation. Without tabindex="-1", someone tabbing through the form lands in a field they cannot see.

Log rejected submissions for a while after you add the honeypot. If real messages show up there, the field is not hidden well enough.

When is a honeypot enough?

A honeypot on its own is enough when the form is a contact, comment or newsletter form with modest traffic, the spam you get is generic (ads, links, nonsense) rather than aimed at your site, and a spam message that slips through is a nuisance, not a loss.

It is not enough for logins, signups, password resets or checkouts. Bots attack those because there is something to gain, and whoever runs them will take the minute it needs to skip a hidden field. It is also not enough once spam keeps arriving after you added it: that is the sign that the bots render your page. At that point add rate limits and an invisible CAPTCHA, and keep the honeypot as the first layer. For contact forms specifically, our page on form spam protection goes into more detail.

If you would rather keep everything on your own servers, our guide to open source CAPTCHA compares the self-hosted options.

Where TrustCaptcha fits

TrustCaptcha builds several honeypot fields into its widget, so you get the trap without writing it. They work next to proof-of-work, which the browser solves in the background on every plan and which gets harder with the risk of the request. From the Solo plan, each request also gets a bot score. Visitors solve nothing: the widget starts on its own.

TrustCaptcha sets no cookies, processes data in EU data centers and includes a Data Processing Agreement for every customer. A honeypot of your own still works fine next to it.

Try TrustCaptcha

Every plan starts with a 14-day free trial, and non-commercial websites can use TrustCaptcha for free with 500 verifications a month. Start your free trial and put it on the form where your honeypot stopped being enough.

FAQs

What is a honeypot CAPTCHA?
A honeypot CAPTCHA is a hidden form field that visitors never see and bots fill in. If the field arrives with a value, your server treats the submission as spam. Visitors do not solve anything, so strictly speaking it is a trap rather than a CAPTCHA.
How does a honeypot field work?
You add an extra input to the form and hide it with CSS. People do not see it and leave it empty. Many spam bots fill in every field they find, including the hidden one, and your server rejects any submission where it is filled in.
Is a honeypot better than reCAPTCHA?
They do different jobs. A honeypot is free, invisible and sends no data to a third party, but it only catches bots that fill in every field. reCAPTCHA also targets bots that run a real browser, at the cost of visitor data going to Google, a cookie and, with v2, image puzzles when it is unsure.
Is a honeypot enough to stop spam?
For a small contact or comment form, often yes. It fails against bots that render the page like a browser or were built for your site. If spam still gets through, add rate limits and an invisible CAPTCHA with proof-of-work.
Can bots detect honeypot fields?
The better ones can. A bot that renders the page in a headless browser sees that the field is hidden, and a bot written for your form simply leaves it out. That is why a honeypot is a first layer, not the whole defense.
Can a honeypot block real visitors?
Yes, if the field is not hidden properly. Browser autofill can fill hidden fields, and screen reader or keyboard users can reach a field that is only hidden visually. Hide it from assistive technology with aria-hidden, take it out of the tab order and turn off autocomplete.
Is a honeypot GDPR compliant?
A honeypot runs on your own server, sends nothing to a third party and sets no cookies, so it adds very little to the data your form already processes. This is not legal advice; if you are unsure, ask your data protection officer.
Can I use a honeypot and a CAPTCHA together?
Yes. The honeypot catches the simple bots for free, and the CAPTCHA deals with the ones that render the page. TrustCaptcha builds several honeypot fields into its widget, so you get both with one integration.

Stop bots and spam

Stop spam and protect your website from bot attacks. Secure your website with our user-friendly and GDPR-compliant CAPTCHA.