New guide: how to warm up a dedicated IP without hurting your reputation. Read now →
Log in
MigoSMTP
SecurityUpdated 4 Nov 2026

Stop bot signups on email forms: honeypot, CAPTCHA and Turnstile compared

How to stop bots from filling your newsletter and signup forms, with a practical comparison of honeypot fields, CAPTCHA, Cloudflare Turnstile, rate limiting and double opt-in, including server-side code you can adapt.

LF
Written by Lena Fischer
European Deliverability and Privacy Liaison
Reviewed by Karan Malhotra
  • Published24 Aug 2023
  • Read time7 min
  • Length1,481 words
Share this guide

Bots fill public signup forms for several reasons: to pad lists with fake addresses, to probe for forms that send a confirmation email to any address, to push spam links through a name field, or to cause harm to third parties by making your form email a victim. The result is bounces, complaints, wasted sends and, in the worst case, damage to your sending reputation.

No single control stops all bots. The effective approach is layered: a honeypot field and a time check to catch simple bots cheaply, a challenge such as Cloudflare Turnstile or another CAPTCHA for the rest, rate limits on the server, and double opt-in so that an address only receives marketing mail after its owner confirms. This guide compares the options and gives code you can adapt.

Cheapest layerHoneypot field plus a minimum fill time, invisible to people
Strongest layerA server-verified challenge token (Turnstile, reCAPTCHA or hCaptcha)
Always neededServer-side validation and rate limits, since bots skip your front end
Final safety netDouble opt-in, so unconfirmed addresses never join the list

What bot signups cost you

  • Bounces and invalid addresses from made-up emails, which hurt reputation. See bounce rate.
  • Spam trap hits if bots submit scraped or typo addresses.
  • Complaints from real people whose addresses were entered by a bot and who then receive a message they never asked for.
  • Sending cost and noise in your analytics.
  • Abuse of your form as a relay for unwanted messages. See email bombing and subscription bombing.

The options compared

ControlHow it worksStrengthsWeaknesses
Honeypot fieldA hidden field that people never fill but naive bots doFree, invisible, no frictionDefeated by bots that render the page or skip hidden fields
Minimum fill timeReject a submission that arrives faster than a person could typeFree, invisibleEasy for a bot to wait; needs a signed timestamp
CAPTCHA (reCAPTCHA, hCaptcha)Challenge or risk score verified on the serverStrong against many botsFriction, privacy and accessibility concerns, third-party dependency
Cloudflare TurnstileChallenge that is usually invisible, verified on the serverLow friction, often no puzzle shown to the visitorThird-party dependency; confirm current terms and limits
Rate limitingCap submissions per IP, address and formStops floodsAttackers rotate IPs; limits can affect shared networks
Double opt-inSend a confirmation message and wait for a clickRemoves fake and mistyped addresses, proves consentDoes not stop the confirmation email being sent to a victim by itself
Address validationCheck syntax, domain, MX and disposable domainsCatches obvious junkCannot prove the person owns the address

Layer 1: a honeypot and a time check

A honeypot is an extra field that is hidden from people with CSS and removed from keyboard navigation and assistive technology. A bot that fills every field reveals itself. Do not use display:none alone as the only technique if you can avoid it, since some bots skip such fields; positioning the field off screen works better. Give it a plausible name and turn autocomplete off.

<form method="post" action="/subscribe">
  <label for="email">Email</label>
  <input type="email" id="email" name="email" required autocomplete="email">

  <!-- Honeypot: people never see or fill this -->
  <div style="position:absolute;left:-9999px" aria-hidden="true">
    <label for="website">Leave this field empty</label>
    <input type="text" id="website" name="website" tabindex="-1" autocomplete="off">
  </div>

  <input type="hidden" name="ts" value="{{ signed_timestamp }}">
  <button type="submit">Subscribe</button>
</form>

On the server, reject if the honeypot has a value or if the signed timestamp shows a submission in less than about two seconds. Return the same success message either way so the bot learns nothing.

// Node.js (Express) example
const crypto = require('crypto');
const SECRET = process.env.FORM_SECRET;

function sign(ts) {
  return crypto.createHmac('sha256', SECRET).update(String(ts)).digest('hex');
}

app.post('/subscribe', (req, res) => {
  const { email, website, ts, sig } = req.body;
  const age = Date.now() - Number(ts);
  const valid = sig === sign(ts) && age > 2000 && age < 3600 * 1000;
  if (website || !valid) return res.json({ ok: true }); // silent drop
  // continue with validation, challenge check and confirmation email
});

Layer 2: a verified challenge

A challenge widget produces a token in the browser. The token is worthless until your server sends it to the provider for verification. Never trust a token that has not been verified server-side, and never place the secret key in front-end code. Cloudflare Turnstile is one option; reCAPTCHA and hCaptcha work in the same way with different endpoints. Check the provider's current documentation for setup, limits and terms.

<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
<form method="post" action="/subscribe">
  <input type="email" name="email" required>
  <div class="cf-turnstile" data-sitekey="YOUR_SITE_KEY"></div>
  <button type="submit">Subscribe</button>
</form>
curl -s https://challenges.cloudflare.com/turnstile/v0/siteverify \
  -d "secret=$TURNSTILE_SECRET" \
  -d "response=$TOKEN_FROM_FORM_FIELD_cf-turnstile-response" \
  -d "remoteip=$CLIENT_IP"
# Response is JSON. Accept the submission only when "success" is true.

The same pattern applies to reCAPTCHA (token in g-recaptcha-response, verified at its siteverify endpoint) and hCaptcha (token in h-captcha-response). Tokens are single use and expire quickly, so verify when the form is submitted and handle a failure by asking the visitor to try again. Provide an accessible alternative where required, and mention the challenge provider in your privacy information.

Layer 3: rate limits and validation on the server

  1. Limit per IP and per address. For example, a handful of submissions per IP per hour and one confirmation email per address per period. Pick numbers that fit your traffic.
  2. Limit confirmation emails to the same recipient. This stops your form from being used to flood one inbox.
  3. Validate the address. Check syntax, domain existence and MX, and consider rejecting known disposable domains. See detecting disposable addresses and validation before sending.
  4. Reject unexpected fields and oversize input. Strip newlines from fields that could reach a mail header. See header injection.
  5. Log and alert. A sudden spike in signups with similar patterns is a signal worth an alert.

Layer 4: double opt-in

Double opt-in means a new subscriber is added to your sendable list only after clicking a link in a confirmation message. It removes typos and addresses entered by bots for other people, and it records proof of consent. It is the main defence against polluted lists, but not a substitute for bot protection, because the confirmation email itself is sent to whatever address was submitted. Keep that message plain and short, include a clear note about who requested it and expire the link after a sensible period. See how to set up double opt-in and the signup form guide.

Measuring whether it works

Protection is only useful if you can see its effect. Track the share of submissions rejected at each layer, the confirmation rate (confirmed signups divided by confirmation emails sent), the bounce rate of confirmation emails and the number of complaints that mention a signup you did not make. A healthy form has a high confirmation rate and a very low bounce rate on confirmation mail. If the confirmation rate falls while submissions rise, you are probably being targeted. Review the data weekly during an attack and monthly otherwise, and adjust limits gradually so that you do not lock out real visitors on shared networks such as offices and mobile carriers.

Choosing a combination

SituationSuggested setup
Small blog newsletter, light trafficHoneypot, time check, validation and double opt-in
Growing list with occasional bot wavesAdd Turnstile or another verified challenge and per-IP limits
Under active attackChallenge on every submission, strict per-address limits, temporary pause of confirmation emails to new domains
Accessibility is a priorityPrefer low-friction challenges, provide an alternative, and rely on honeypots, rate limits and double opt-in
No control over the front endPut protection at a proxy or the form handler, and verify on the server

Troubleshooting

ProblemLikely causeWhat to do
Bots still get throughServer does not verify the token, or the form endpoint is called directlyVerify the token on the server for every submission and require it
Real users are blockedHoneypot filled by autofill, or time check too strictName the honeypot field unlike common autofill fields and relax the minimum time
Challenge fails for some visitorsBlocked scripts, strict privacy settings, expired tokenShow a clear retry message and an alternative path
Confirmation emails bounce a lotFake addresses still reaching the senderAdd validation and per-domain limits, review the bounce reasons
Complaints about unsolicited confirmation mailVictims of third-party submissionsTighten limits, add a challenge and keep the message clearly worded

Start with the cheap layers, add a verified challenge when bots persist, and keep double opt-in as your safety net. Review the numbers regularly: confirmation rate, bounce rate and the share of submissions rejected at each layer tell you which control is carrying the load.

Protect your sender reputation Suppression of hard bounces and complaints, plus webhooks for every delivery event.

Explore the SMTP relay

References and further reading

Frequently asked questions

What is the best way to stop bot signups?

Use layers: a honeypot and time check, a server-verified challenge such as Turnstile, rate limits and double opt-in.

Does a honeypot field stop all bots?

No. It stops simple bots that fill every field, but more capable bots skip hidden fields, so add a verified challenge.

Is Cloudflare Turnstile better than reCAPTCHA?

It is usually less intrusive for visitors, but both work the same way with server-side verification. Compare current terms, privacy and limits.

Does double opt-in prevent bot signups?

It keeps unconfirmed addresses off your list, but the confirmation email is still sent, so you also need bot protection and rate limits.

Why must I verify the CAPTCHA token on the server?

Because a bot can post to your endpoint directly. Without server-side verification the token proves nothing.

Topics#bots#signup forms#honeypot#captcha#turnstile#abuse prevention
Was this guide helpful?Your answer helps us improve our documentation.

Start sending in minutes.

Create an account, add your domain and send your first email.

Get started Talk to sales