
Every contact form has two audiences. One wants to talk to you. The other wants to use your form as free infrastructure: to send mail from your domain, to test a list of addresses, or to leave a link on a page that carries your domain’s reputation.
Those two need different answers. Most sites give them the same one — a puzzle at the bottom of the form — which is the most expensive layer for the visitor and the easiest for a bot to route around with a rented solving service.
The Form Is Working as Designed
OWASP’s introduction to automated threats describes the situation better than most security advice does:
Web applications are subjected to unwanted automated usage – day in, day out. Often these events relate to misuse of inherent valid functionality, rather than the attempted exploitation of unmitigated vulnerabilities.
A contact form’s inherent valid functionality is accepting a POST and sending an email. A bot does exactly that. Nothing is broken, which is why patching and firewalls rarely change the volume.
Three separate problems get called “form spam”, and they are handled in different places.
- Inbox noise. Messages you read and delete. Cost is your attention.
- Mail reputation. The form mails arbitrary addresses, some invalid, some spam traps. Cost is your domain’s sending reputation, which is the reason a legitimate invoice lands in a customer’s junk folder six months later.
- Site reputation. An injected form, a compromised plugin, or open registration puts links and pages on your domain. Cost is search visibility, and it is the only one of the three that Google can see.
The checklist below is ordered by what each layer costs a real visitor, cheapest first. That ordering is the whole argument: a layer with zero cost to a human should be exhausted before you consider one that taxes everyone.
The Layers, Side by Side
| Layer | Catches | Cost to a real visitor | Blind spot |
|---|---|---|---|
| Honeypot field | Bots that fill every input | None, if hidden properly | Bots that parse CSS |
| Time trap | Scripted posts sent instantly | None | Bots that wait, cached timestamps |
| Content rules | Messages with many links | A false positive, rarely | Human spam |
| Akismet | Known spam patterns | None visible | New patterns, occasional false positive |
| Score-based check | Automation signals | None visible | Needs JavaScript, privacy questions |
| Visible puzzle | Determined bots | High — attention, accessibility | Paid solving services |
| Moderation queue | Everything | Your time | Nothing, but it scales badly |
No row wins on its own. The point of the table is that the bottom three rows are where sites start, and they are the rows with the highest price.
Layer One: A Field No Person Can See
The honeypot is a text input that a browser hides and a bot fills. It costs nothing to render, nothing to submit, and nothing to a screen reader, as long as the hiding is real.
In Contact Form 7, add one line to the form body. The contact form walkthrough covers the form itself if you are building from scratch:
<div class="form-trap" aria-hidden="true">[text company-website]</div>
and one rule to the stylesheet:
.form-trap { display: none; }
Then reject any submission where that field has a value. The full check, with the timer from the next section, is a small mu-plugin:
<?php
/**
* Plugin Name: Form Trap
* Rejects Contact Form 7 submissions that fill the hidden field
* or arrive faster than a person can type.
*/
add_filter( 'wpcf7_form_hidden_fields', function ( $fields ) {
$fields['awp_started'] = time();
return $fields;
} );
add_filter( 'wpcf7_spam', function ( $spam, $submission = null ) {
if ( $spam || ! $submission instanceof WPCF7_Submission ) {
return $spam;
}
$posted = $submission->get_posted_data();
$trap = isset( $posted['company-website'] ) ? trim( (string) $posted['company-website'] ) : '';
$started = isset( $posted['awp_started'] ) ? absint( $posted['awp_started'] ) : 0;
if ( '' !== $trap ) {
return true;
}
if ( $started && ( time() - $started ) < 2 ) {
return true;
}
return $spam;
}, 20, 2 );
display: none rather than off-screen positioning is the deliberate choice. A field moved out of the viewport with position: absolute; left: -9999px is still in the tab order, so a keyboard user can land in a field they cannot see and cannot leave without tabbing again. display: none removes it from the tab order and from the accessibility tree at once, and aria-hidden states the intent for anything reading the markup.
The trade-off is honest: a bot that reads stylesheets sees nothing to fill. That is the case the timer exists for.
Layer Two: The Clock
awp_started is written when the form renders and compared when it is submitted. A human needs more than two seconds to type a name, an email, and a message. A script needs milliseconds, and scripts that replay a form template often submit before the page has finished painting.
Two seconds is a floor, not a wall. Raise it to four if your form is short and your audience is fast; the failure mode is a real person who pastes a prepared message and hits send immediately, and that is a support ticket you do not want. Two seconds catches the crude end of the traffic without touching anyone deliberate.
Page caching weakens the trap in a way worth understanding. A cached page carries the timestamp from whenever the cache was built, so a submission an hour later passes comfortably. That is fine: the timer stops the laziest scripts, and it is never the only layer.
Layer Three: Rules Before Scores
Two rules cover most of what survives the trap:
- Count the links in the message. More than two URLs in a first-contact message is not a customer. Most real enquiries contain none.
- Check the fields that should be short. A “name” field containing 400 characters is a payload, not a person.
Both are free, both are readable, and both are easy to over-tune. Start by logging rather than blocking: write the rule outcome to a file for a week, then look at what it would have rejected. If the answer includes real customers, the rule is wrong, not the customer.
Akismet belongs at this stage too, and Contact Form 7’s own documentation makes the case for stacking rather than choosing:
Contact Form 7 provides several spam protection modules; we recommend utilizing different types in combination.
The realistic limit of a content rule is language. Spam text is often not in your site’s language, and filtering on character sets is a fast route to rejecting a legitimate customer who writes in another script. Reject on structure — links, lengths, field abuse — and leave language alone. If you would rather not maintain any of this in a mu-plugin, the free anti-spam plugin comparison covers what each one actually adds.
Layer Four: Scores, Not Puzzles
A score-based check asks a vendor’s model how likely the interaction is to be a bot and hands you a number. reCAPTCHA v3 is the documented example:
reCAPTCHA v3 returns a score (1.0 is very likely a good interaction, 0.0 is very likely a bot).
The relevant defaults, straight from the same page: a threshold of 0.5 to start from, and a promise that “reCAPTCHA v3 will never interrupt your users”. That last line is why the layer costs a real visitor nothing, and it is also why the layer is weaker than it sounds. A score is an estimate, and Google says so: “scores in a staging environment or soon after implementing may differ from production.”
The Contact Form 7 integration is where this layer usually goes wrong, because a widget that fails to load looks identical to one that passed.
Cloudflare Turnstile is the other option and describes itself as “Cloudflare’s smart CAPTCHA alternative”, which “works without showing visitors a CAPTCHA”. Its documentation lists WCAG 2.2 AA compliance for the widget, and notes that it can be embedded “without sending traffic through Cloudflare” — worth knowing if the site is not behind their proxy.
The practical sequence for either one:
- Install it in observe mode. Do not block.
- Log the score or outcome for every submission for a week.
- Read the distribution. If real enquiries cluster at 0.6 and bots at 0.2, a threshold of 0.4 is defensible; if everything lands at 0.5, the score is telling you nothing about your traffic.
- Only then turn on rejection, and re-check the week after.
Choose one provider, not both. Running two invisible checks doubles the third-party scripts on a page that already has too many, and the second score rarely changes a decision the first one made.
The Accessibility Line
There is a temptation to reach for WCAG 3.3.8 here and call every CAPTCHA a violation. The criterion is narrower than that: it covers authentication steps — logging in, recovering an account — not a public contact form. Quoting it against a contact form is a stretch, and a stretch is easy for a client to dismiss.
The reasoning is still worth stealing, because it explains why “there is an audio option” is not the answer it appears to be. From the Understanding document for 3.3.8:
Some CAPTCHA systems have an audio alternative of the visible text. If the user needs to transcribe this audio, it cannot be used to meet the Alternative exception.
Transcription is the cognitive load the criterion exists to remove. An audio challenge that asks someone to type what they heard has moved the difficulty rather than solved it, and it fails the people most likely to need the alternative.
That is the argument for invisible scoring over visible puzzles, and it is an argument about the visitor, not about compliance. A form that never asks a question cannot fail the question.
When the Spam Lands on the Site
Inbox spam is annoying. Injected spam is expensive, and it looks nothing like a filled form.
Three patterns to check when something has already landed:
- New URLs you did not publish. Search Console’s Pages report, filtered to “Crawled — currently not indexed” and to new indexed URLs, is the fastest signal. A site with a form-to-email script and a weak upload path can host pages for months without anyone noticing.
- Outbound mail you did not send. Check the mail log for volume and for recipients outside your customer base. A form that mails an address supplied by the visitor is an open relay with extra steps, which is how the deliverability problem starts.
- Registration and comment volume. A spike in either is a spam run starting, and the cleanup is easier before the pages are indexed.
The SEO spambot recovery guide covers the containment side once links are live. Prevention is the checklist above plus one rule about forms: never let a public form choose its own recipient. Send to a fixed address in the site’s configuration.
Proving It Worked
Changing three layers at once tells you nothing, so measure in order.
- Baseline for two weeks. Count spam per week before touching anything. Use the form plugin’s own log if it has one, otherwise a folder rule in the mailbox.
- Ship one layer. Re-count the following two weeks. Two data points is not statistics, but a layer that changes nothing is visible even in a small sample.
- Test the form as a visitor. Phone, desktop, a VPN, JavaScript disabled, and a screen reader if you have one. Confirm the success message appears and the mail arrives.
- Check the mail log, not the inbox. A blocked submission should produce no outbound mail. If the volume in the log does not fall when the inbox does, the spam is being filtered after the send, which fixes nothing that matters.
A form that blocks nothing and sends nothing is broken. The target is a form that a customer can complete in twenty seconds and a script cannot complete at all, and only the visitor test tells you whether the first half is still true.
FAQ
Is a honeypot enough on its own?
For a low-traffic site with a plain form, often yes for months at a time. It stops the generic bots that fill every field, which is most of the traffic. It does nothing against a targeted run or a solving service, so pair it with the clock and one content rule.
reCAPTCHA v3 or Turnstile?
Either, chosen once. Both score invisibly and both cost a real visitor nothing. Turnstile documents WCAG 2.2 AA compliance and can run without routing traffic through Cloudflare; reCAPTCHA has the longer track record and more plugin integrations. Running both is more script weight for a marginally different answer.
Why does spam still arrive after adding a CAPTCHA?
Because a CAPTCHA answers “is this a bot”, and some of your spam is sent by people, or by a service that solves the challenge for a fraction of a cent. If the message is well written and irrelevant, check the sending IP and the links before assuming the plugin failed. A widget that never renders is the other common cause, and the grecaptcha reference error is what that looks like in the console.
Can contact form spam hurt SEO?
Not the messages themselves. The damage comes from what a compromised form enables: injected pages, link drops, and a sending reputation that starts routing your real mail to junk. Those show up in Search Console and in the mail log, not in the inbox.
Does a hidden field break accessibility?
Not if it is hidden with display: none. That removes it from the tab order and the accessibility tree. Off-screen positioning is the version that breaks: the field stays focusable and a keyboard user can land in something invisible.