Contact forms without spam and without captcha
Forms built with the Forms module (contact, footer, support…) stop spam without captcha: real people do not have to solve anything, and automated messages are set aside on their own.
How spam is detected
Each message is checked against several signals at once:
- Time to fill in: the form carries a mark of when the page was loaded. A submission within a couple of seconds is not made by a person.
- Trap field: an invisible field people never see and robots fill in.
- Typical spam content: links or HTML in the message, links in the name, the name repeated as the message, alphabets that do not match the site.
- Disposable emails: addresses from throwaway services.
- Repetition: too many submissions in a row from the same connection or the same email, and the same message sent to many sites at once (spam campaigns).
Weak signals are not enough on their own: several are needed together to flag a message. That way, someone in a hurry or pasting a link is not blocked.
What happens to a spam message
- It is stored and flagged as spam, with the reason noted, so you can review it.
- No email notification is sent. Your inbox only gets the good messages.
- The sender sees the same “message sent” reply. That way the robot does not know it was caught and cannot learn to get around the filter.
You can see them in Forms → Submissions, using the spam filter. If one was genuine, remove the flag.
Email notifications
- The subject ends with the site's domain (for example, “New contact · example.com”), so you know which site it came from when you run several.
- The notification includes a “Web:” line with the domain and the page it was sent from.
- It goes to the address set in the form. If that address is the platform's general one and the site has its own contact email (in its settings), the notification goes to the site's address instead. That way each site receives its own messages.
Cached pages
Cached pages serve the same HTML to every visitor. To keep the form working, the security token and the time mark are refreshed in the background when the page loads. You do not need to do anything.
Forms written in a template
If a theme has its own contact form (without the module), add these two fields inside the <form> to give it the same protection:
<input type="hidden" name="_ft" value="{{ form_time_token() }}">
<div style="position:absolute;left:-9999px" aria-hidden="true">
<input type="text" name="_hp_web" value="" tabindex="-1" autocomplete="off">
</div>
Frequently asked questions
Why not use a captcha?
Because people suffer it, not robots: many captchas are solved automatically, while they make real people abandon the form.
Is any message lost?
No. Everything flagged as spam is stored, and you can review it and remove the flag.
What about sales messages written by a person?
If a person writes them, they usually get through. That is intended: the filter looks for automated messages; it does not decide what interests you.
Troubleshooting
- A genuine message was flagged as spam: remove the flag in Forms → Submissions. If it happens often, check the noted reason and let us know.
- I sent several tests in a row and the last ones were flagged: that is expected; there were too many submissions from the same connection. Wait a few minutes between tests.
- I do not receive notifications: check the form's address and the site's contact email, and that the site can send email (SMTP).