Falkenstein, Germany · Hetzner Online GmbH
FormHaven

Stop contact form spam without a captcha

Bots crawl the web for forms and post to every one they find, mostly to plant links. Each layer below catches a different kind of bot, and none of them asks your visitor to pick out traffic lights. Here they are in the order FormHaven runs them on every message.

14 days free, no card. Paste the address where the code says YOUR_FORM_ID.

contact.html
<script src="https://formhaven.net/bot-check.js" async></script>
<form action="https://formhaven.net/f/YOUR_FORM_ID" method="POST">
  <input type="email" name="email" required>
  <textarea name="message" required></textarea>
  <!-- people never see this field; bots fill it in -->
  <input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Send</button>
</form>

The layers, in the order they run

  1. 1

    A hidden trap field

    The _gotcha input is hidden from people. A bot that fills in every field fills that one in too, and its message goes straight to spam.

  2. 2

    Only your own sites

    List your domains in the form's settings, and a copy of your form posted from any other site goes to spam. A domain covers its subdomains, and localhost always passes so you can test.

  3. 3

    An invisible bot check

    The visitor's browser solves a small puzzle before the form sends. A bot that posts to the address without loading your page has no answer to send. No cookies, nothing to click.

  4. 4

    What the message says

    Forum link code such as [url=], more than 4 links in one message, or one of your own spam words sends it to spam.

Why your form gets spam

Your form's address sits in your page's HTML, where any crawler can read it. Most form spam is a script: it finds the form, fills in every field it sees, a hidden one included, and posts to the address directly, without ever loading the page. That is why a hidden field and a check that runs in the browser catch it. A person paid to paste offers by hand passes both, and that is what spam words and Block this sender are for.

What a spam bot sends
curl -X POST https://formhaven.net/f/YOUR_FORM_ID \
  -d "email=offers@example.com" \
  -d "message=More traffic for your site: [url=https://spam.example]click[/url]" \
  -d "_gotcha=https://spam.example"

Turn on the bot check

Add this line once to every page with the form, after you switch the check on in its settings. A puzzle stays valid for two hours, so a page left open still sends, and each answer works once. A visitor whose browser runs no JavaScript fails it too: their message waits in the spam list rather than disappearing.

contact.html
<script src="https://formhaven.net/bot-check.js" async></script>

Spam words and Block this sender

Each form takes up to 50 spam words and blocked senders together, in the dashboard or with one API call. The email you get for each message has a Block this sender link: it moves that message to spam and adds the sender's company domain to the list, or only the address when it is at a shared provider such as gmail.com.

Terminal
curl -X PATCH https://formhaven.net/api/v1/forms/YOUR_FORM_ID \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bot_check": true, "spam_words": ["seo services", "crypto"]}'

Questions about this setup

Do I need a captcha?
Usually not. A captcha asks every visitor to do a task before they can send. The layers above run without the visitor noticing, and spam words catch what a person types by hand.
Does a bot learn that it was caught?
No. Spam gets the same answer as a real message, so a bot has nothing to adjust to. You see it in the form's spam list, with the reason it was caught.
Does spam count toward my submissions?
No. Only real messages count, and spam is never emailed to you.
What if a real message lands in spam?
Open it in the spam list and press Not spam to move it back. Anything caught by a layer other than the hidden field is kept for the form's retention days, so a visitor on a site you forgot to list, or one without JavaScript, can still be found.
Is there a rate limit?
Yes. One address can send 10 messages a minute to a form. Past that it gets a 429 answer asking it to wait a minute.

More to read

FormHavenThe form backend with every layer built in Astro contact formA Contact.astro component for a static Astro site HTML form to emailOne line in the action, every message in your inbox Static site contact formOne form for Astro, Hugo, Eleventy, Jekyll or plain HTML Hugo contact formA partial and a shortcode for a static Hugo site Lovable contact formOne prompt for a site built with Lovable GDPR compliant contact formEU storage, a DPA and retention you set Kontaktformular nach DSGVOAuf Deutsch: gespeichert in Deutschland, mit AVV JavaScript contact formA fetch script that keeps the visitor on the page Vercel contact formFor plain HTML, Astro or Next.js hosted on Vercel FormSubmit not workingThe usual causes of a silent FormSubmit form Web3Forms not workingThe usual causes of a silent Web3Forms form Eleventy contact formAn include for a static Eleventy (11ty) site Formspree not workingThe usual causes of a silent Formspree form Export from FormspreeEvery Formspree submission, as a file Export from FormsparkEvery Formspark submission, as a file EmailJS not workingThe usual causes of a silent EmailJS form Form backend for AI agentsThe start request, every REST route and MCP tool Claude Code contact formOne prompt, then press Activate Cursor contact formThe prompt and the .cursor/mcp.json entry Contact form privacy policyThe paragraph to copy, in 8 languages GitHub Pages contact formFor user, organisation and project sites on github.io Cloudflare Pages contact formFor sites on pages.dev or your own domain Netlify contact formFor sites on netlify.app or your own domain React contact formOne component for Vite and other React apps Next.js contact formA client component that works with output: export Send form submissions to multiple emailsUp to 5 confirmed addresses per form, plus yours SvelteKit contact formOne Svelte 5 component, any adapter Nuxt contact formOne Vue component for Nuxt 4 and 3 Gatsby contact formOne component for a Gatsby 5 site HTML form webhookSigned JSON to your endpoint for every message Jekyll contact formAn include for Jekyll, on GitHub Pages or any host Angular contact formA standalone component that posts with HttpClient Contact form honeypotThe hidden field that catches bots, and how to hide it Contact form without PHPFor hosts with no PHP, or mail() that lands in spam HTML form mailtoWhy action="mailto:" fails on webmail visitors, and the one-line fix Contact form templateThe same form in plain HTML Pricing€1 per form a month, €0.50 from the 11th

Get your form address in a minute

14 days free, no card. Then €1 per form a month, €0.50 from the 11th form.

Start your 14-day trial