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.
<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
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
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
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
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.
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.
<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.
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
Get your form address in a minute
14 days free, no card. Then €1 per form a month, €0.50 from the 11th form.