Your contact form gets spam: how to stop it without scaring off customers

Bot messages, strange links and SEO offers: why forms attract spam and which layers to use to stop it (honeypot field, invisible verification, rate limits and server-side validation) without putting obstacles in the way of people who want to write to you.
If you have a contact form on your website, you almost certainly receive absurd messages: texts in other languages, suspicious links, offers to "improve your search ranking". Behind them are automated programs that roam the internet filling in every form they find.
It's annoying, but not only that. Spam buries real messages from customers, can fill your inbox until you stop checking it and, if the form is badly built, can be used to send emails from your server to third parties.
Why bots reach your form
It's nothing personal. Bots look for forms on a massive scale and fill them all in the same way. That's why the defences that work are the ones that detect machine behaviour, not the ones that make life harder for people.
Layers that work
There's no single solution, so the best approach is to combine several:
- Honeypot field. A hidden field that people don't see and bots fill in. If it arrives with content, the message is discarded. It's invisible to the customer and stops the simplest bots.
- Invisible verification. Services such as Cloudflare Turnstile or reCAPTCHA check in the background whether the visitor is a person, usually without asking them to pick out traffic lights. If you choose one, mention it in your privacy policy and, if it uses cookies, in your banner too.
- Submission limit. The same connection shouldn't be able to send dozens of messages in a few minutes.
- Server-side validation. The checks done by the browser are easy to bypass. The server must verify that the required fields arrive, that the email has a valid format and that the privacy box has been accepted.
What to avoid
- Captchas with distorted letters or looking for bicycles in photos. They slow down people almost as much as bots, and they're a serious obstacle for anyone with a disability.
- Publishing your email address in plain text on the website instead of a form. Bots harvest it and you'll end up receiving spam straight into your inbox.
- Forms that automatically send a copy, with the text the visitor wrote, to the email address the visitor entered. It's an open door for people to use your website to send spam to others.
Don't forget the legal side
A contact form collects personal data, so the basic data protection information must be visible next to it (who the controller is, what the data is used for, the legal basis, whether it's shared with anyone and how to exercise your rights) along with a link to the privacy policy. If you ask people to tick a box to accept, it must not be ticked by default, and the server must reject submissions that arrive without it.
Check that the good messages get through
After setting up filters, test the form yourself from your phone and from another computer, and check your email's spam folder from time to time. A filter that's too aggressive and swallows customer messages is worse than spam.
If you'd like a protected form that complies and only sends you what matters, you can tell me about your case at pablopedrosa.com, no strings attached.