Skip to main content

Contact Form 7 spam

Contact Form 7 reCAPTCHA v3 not working, or spam still getting through?

The short answer

First check that Contact Form 7 says “reCAPTCHA is active on this site” under Contact → Integration, and that the keys are v3 keys. Then read the spam log to see the score Google gave the message. If the junk that still gets through is typed by people, reCAPTCHA can’t stop it: it tells robots from people, so a pitch typed by a person needs a check that reads the message.

1. Check that reCAPTCHA is on

  • In WordPress, go to Contact → Integration. The reCAPTCHA box says “reCAPTCHA is active on this site” once a Site Key and a Secret Key are saved. If it doesn’t, press Setup integration and paste both keys.
  • Contact Form 7 uses reCAPTCHA v3. Keys made for v2 don’t work with v3: register your site again in Google’s reCAPTCHA admin console to get v3 keys.
  • A key works on the domains you list for it and their subdomains. If your form is on a domain the key doesn’t list, add it.
  • If your developer set the keys in wp-config.php (WPCF7_RECAPTCHA_SITEKEY and WPCF7_RECAPTCHA_SECRET), those are used instead of the keys on the Integration page.

2. You don’t need a [recaptcha] tag

With v3 there is nothing to add to the form and no box to tick. Once the keys are saved, Contact Form 7 adds reCAPTCHA to every form on its own. A [recaptcha] tag left over from v2 prints nothing.

3. Read why a message was marked spam

When reCAPTCHA stops a message, Contact Form 7 writes the reason in a spam log. reCAPTCHA writes one of two:

  • “reCAPTCHA response token is empty.” The token comes from a script that loads from google.com on your page. If that script is blocked or doesn’t run, the token is empty and the message is marked spam.
  • “reCAPTCHA score (0.30) is lower than the threshold (0.50).” Google scored the visit as likely a robot. A score of 0.00 on every message usually means the check itself failed: a wrong Secret Key, or your server couldn’t reach Google. Contact Form 7 then counts the score as zero.

Contact Form 7 doesn’t store messages, so you can only read the log if Flamingo was active when the message arrived. Go to Flamingo → Inbound Messages → Spam and open the message. Its Status box shows each “Spam log:” line, and its reCAPTCHA box shows Google’s answer, score included.

If a real customer says their message never arrived, Contact Form 7 marked a message as spam: was it a real lead? covers how to find it and which check flagged it.

4. The score and the threshold

  • reCAPTCHA v3 scores each visit from 0.0 (very likely a robot) to 1.0 (very likely a good interaction).
  • Contact Form 7 lets a message through only when its score is above the threshold, 0.50 unless a developer changes it with the wpcf7_recaptcha_threshold filter.
  • Google suggests starting at 0.5 and looking at your traffic in the admin console before you change it. Scores soon after you set it up may differ from later ones.

5. When spam still gets through

Contact Form 7 describes reCAPTCHA as a way to block “abusive form submissions by spam bots”. A sales pitch or an SEO offer typed by a person in a real browser is a real visit. It can score well and arrive like any other message.

That kind needs a check that reads the message. Spam Shield does that for Contact Form 7 and WPForms:

  • It checks each message after Contact Form 7’s own checks have passed it, just before the email goes out. You keep reCAPTCHA.
  • A message that looks like spam is held on Settings → Spam Shield → Blocked messages instead of emailed. The sender isn’t told it was held.
  • If a held message was real, Not spam: deliver it sends the form’s normal email.
  • If the check is slow or down, the message is delivered as normal.

The free key covers 50 checks a month.

More questions

Do I need a [recaptcha] tag in my Contact Form 7 form?

No. With reCAPTCHA v3, Contact Form 7 adds reCAPTCHA to every form once the keys are saved. A [recaptcha] tag left over from v2 prints nothing.

Why is every message marked as spam?

Read the spam log in Flamingo. “reCAPTCHA response token is empty” means the reCAPTCHA script didn’t run on the page. A score of 0.00 on every message usually means a wrong Secret Key, or that your server can’t reach Google.

Can I use my old reCAPTCHA v2 keys?

No. Keys for v2 don’t work with v3. Register your site again in Google’s reCAPTCHA admin console to get v3 keys.

Does Spam Shield replace reCAPTCHA?

No, you can keep both. Spam Shield checks a message after Contact Form 7’s own checks have passed it, so it looks at what reCAPTCHA let through, such as pitches typed by people.

What happens when my free checks run out?

Messages are delivered as normal, without a check, until the next month starts.

Try Spam Shield on your form

A free key checks 50 messages a month. No card. Pro checks 5,000 a month.