Skip to content
FunnelGuard

Fix guide by FunnelsGuard

reCAPTCHA wrong domain or expired keys: form can't submit

OPS-106High impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

reCAPTCHA is Google's tool for telling humans from bots on forms. Each site gets a site key (public, used in the page) and a secret key (private, used by your server to check the visitor's token). Both belong to a list of allowed domains.

The problem starts when the keys don't match the domain the form is on. Common causes: keys copied from a staging or old site, a domain change or new www / subdomain that was never added, keys deleted in the admin console, a key type mismatch (v2 checkbox keys used with v3), or a secret key pasted with a space or the wrong value.

Why it costs you leads or sales

The form is the end of your funnel. When reCAPTCHA fails, every visitor who fills in the form is blocked, and most won't try again or email you. Ad clicks, SEO traffic and referrals all end at a form that can't be sent. Because the page loads fine, the break is easy to miss for weeks.

Where a wrong-domain reCAPTCHA key stops the lead
  1. Ad or search clickVisitor lands on the page
  2. Fills in formFields completed
  3. reCAPTCHA checkInvalid domain or bad key
  4. Form submittedNever sent
  5. Lead in inbox/CRMNothing arrives

The page and form load normally. The break is at the reCAPTCHA check, so nothing reaches the inbox or CRM.

Leads per week before and after the keys breakExample numbers
Leads per week before and after the keys break (example)Before break: 40 leads; Week 1 after: 2 leads; Week 2 after: 1 leads015314021Before breakWeek 1 afterWeek 2 afterleads

Example: a site getting 40 leads a week drops to near zero when reCAPTCHA keys stop validating. Numbers are illustrative.

How to check if your site has it

Check your form by hand
  1. Open the form in a private window

    Use the live URL, not a preview or staging link. Look for the reCAPTCHA checkbox or badge (bottom right for v3). A grey error box or a missing widget is a red flag.

  2. Submit a test lead

    Fill in every field, send it, and see whether you get a success message and an email or CRM entry.

  3. Read the browser console

    Press F12, open Console, and reload. Messages such as 'Invalid site key or not loaded in api.js' or 'Invalid domain for site key' point to the keys.

  4. Check the keys in the admin console

    Go to google.com/recaptcha/admin. Find the site key used on your page and confirm your exact domain (including www or subdomains) is listed under Domains.

  5. Check the server side

    If the widget looks fine but the form still fails, the secret key may be wrong. Look at your form plugin or server logs for 'invalid-input-secret' or 'browser-error' from the siteverify call.

How to fix it

First fix the keys in Google's admin console, then paste them where your form uses them. The second part depends on your platform.

Fix the keys in Google reCAPTCHA
  1. Open the admin console

    Sign in at google.com/recaptcha/admin with the Google account that owns the keys. If you don't know the account, create new keys.

  2. Add the missing domain

    Open the site's settings and add your live domain under Domains, without https:// or a path. Adding a root domain covers its subdomains by default.

  3. Or create new keys

    Click the + button, pick the right type (v2 checkbox, v2 invisible or v3), enter your domains and submit. Copy both the site key and the secret key.

  4. Match the key type

    v2 keys do not work with v3 code, and the reverse. Your form tool must be set to the same version you created.

  5. Remove staging domains and stray spaces

    When pasting keys, check there is no leading or trailing space and that site and secret keys are not swapped.

Update the keys where your form uses them
  1. Find the form plugin setting

    Contact Form 7: Contact > Integration > reCAPTCHA. WPForms: WPForms > Settings > CAPTCHA. Gravity Forms: Forms > Settings > reCAPTCHA. Other plugins have a similar settings page.

  2. Paste the new keys

    Enter the site key and secret key for the right version, save, and clear any page cache.

  3. Check security plugins

    If a separate plugin (for example a login or anti-spam plugin) also loads reCAPTCHA, update its keys too.

reCAPTCHA v2 checkbox with the site keyhtml
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<form action="/submit" method="POST">
  <input type="email" name="email" required>
  <div class="g-recaptcha" data-sitekey="YOUR_SITE_KEY"></div>
  <button type="submit">Send</button>
</form>
Test your secret key from the command linebash
curl -s -X POST https://www.google.com/recaptcha/api/siteverify \
  -d "secret=YOUR_SECRET_KEY" \
  -d "response=test"
# A wrong secret returns "invalid-input-secret".
# A valid secret with a fake token returns "invalid-input-response".
Form before and after the key fix

Wrong domain keys

  • Grey 'Invalid domain for site key' box
  • Submit button does nothing or fails
  • No leads in inbox or CRM

Correct keys

  • Checkbox or badge loads normally
  • Form sends and shows success
  • Test lead arrives in inbox and CRM

How to confirm it's fixed

Confirmation checklist
  • Open the live form in a private window and see no reCAPTCHA error
  • Browser console shows no 'Invalid site key' or 'Invalid domain' messages
  • Submit a test lead and see the success message
  • The test lead lands in your inbox and your CRM
  • Test on www and non-www, and on mobile
  • Clear your page cache and CDN cache, then test again

How to prevent it happening again

Prevention checklist
  • Keep a note of which Google account owns the reCAPTCHA keys, ideally a shared company account
  • Use separate keys for staging and live, and never copy staging keys to the live site
  • Add every new domain or subdomain to the key before launch
  • Re-test the form after migrations, theme changes, plugin updates and domain changes
  • Delete unused keys only after checking no live form uses them
  • Run a scheduled test submission so a break is caught in hours, not weeks

How FunnelGuard handles this

FunnelGuard detects this issue only partly. It runs your form journey on a schedule and sees the problem when it shows up as a bot wall (the form step is blocked by a challenge or error) or as a submit failure (the form is sent but no success state or lead appears). In those cases it re-checks from a second region, then sends one alert with a screenshot and a likely cause.

How an unnoticed key problem unfolds
  1. Day 0

    Site moves to a new domain. Keys still list only the old one.

  2. Day 0

    Form shows 'Invalid domain for site key'. Submissions stop.

  3. Day 1-14

    Traffic keeps arriving. Nobody sees an error because the page loads.

  4. Day 15

    Someone notices the lead count has dropped and finds the cause.

  5. Day 15

    Domain added to the key. Test lead arrives.

Questions people ask

Why does my form say 'ERROR for site owner: Invalid domain for site key'?

The site key on your page isn't registered for the domain the form is loaded on. Open the reCAPTCHA admin console, add your live domain (without https://) to that key, or create new keys and paste them into your form settings.

Why is my reCAPTCHA form not submitting?

The most common causes are keys for the wrong domain, a mismatch between v2 and v3 key types, a wrong secret key, or deleted keys. Check the browser console for reCAPTCHA errors and verify the keys in google.com/recaptcha/admin.

Do reCAPTCHA keys expire?

Keys don't normally expire on a fixed date, but they stop working if they are deleted, if the owning account is lost, or if the project is changed. Check the admin console now and then to make sure your keys are still listed.

How do I add a domain to reCAPTCHA?

Go to google.com/recaptcha/admin, open your site, then open Settings and add the domain under Domains. Enter just the hostname, such as example.com, with no https:// or path, and save.

Do I need to add www and subdomains to reCAPTCHA?

Adding the root domain covers its subdomains by default, but only if the option to restrict to listed domains isn't narrowing it. If a form still fails on a subdomain, add that hostname explicitly and test again.

Can I use the same reCAPTCHA keys on staging and live?

You can list both domains on one key, but it's safer to use separate keys. That way a staging change or deletion can't break your live form.

Will a monitoring tool catch a reCAPTCHA key problem?

Partly. A scheduled test that runs your form will catch it when the problem shows up as a blocked step or a failed submission. It won't check your key settings, so review the reCAPTCHA admin console by hand too.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: Seen as bot wall or submit failure.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.