Skip to content
FunnelGuard

Fix guide by FunnelsGuard

reCAPTCHA invalid for domain: fix 'Invalid domain for site key'

DLV-199High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

reCAPTCHA is Google's spam check for forms. Each key pair is tied to a list of allowed domains. The site key is public and loads the widget in the page. The secret key stays on your server and verifies the visitor's token with Google.

If the page's domain is not on the key's list, Google refuses the request. Visitors may see ERROR for site owner: Invalid domain for site key, a grey widget, or nothing at all. Either way the form cannot pass the check, so every submit fails.

Common causes: the site moved from a staging or temporary domain to the live one, the www or a subdomain was never added, keys were copied from another site, a v2 key was pasted into a v3 setting (or the reverse), or the secret key has a typo or trailing space.

Why it costs you leads or sales

This is a hard failure. Visitors fill in the form, press submit and nothing is delivered. Most will not retry or email you. Because ads and SEO keep sending traffic, you pay for visits that cannot convert, and you may not notice, since no spam arrives either and the inbox just looks quiet.

Where the funnel breaks
  1. Ad or search clickVisitor lands on the page
  2. Fills in formDetails entered
  3. reCAPTCHA checkInvalid domain for site key
  4. Email to inboxNever sent
  5. Lead in CRMNever created

The reCAPTCHA check fails, so nothing after the submit happens.

Leads per week before and after a domain changeExample numbers
Leads per week before and after a domain change (example)Week before move: 24 leads; Week after move: 0 leads; Week after fix: 23 leads091824023Week before moveWeek after moveWeek after fixleads

Example: illustrative numbers for a site that moved to a new domain without updating the reCAPTCHA key.

How to check if your site has it

Check your form in five minutes
  1. Load the live form in a private window

    Look at the reCAPTCHA box. A red 'ERROR for site owner' message or 'Invalid domain for site key' means the domain is not registered.

  2. Open the browser console

    Press F12 and open Console. Look for messages mentioning reCAPTCHA, 'Invalid site key' or 'Invalid domain'.

  3. Submit a real test entry

    Use your own email. If the form shows an error such as 'reCAPTCHA verification failed' or just hangs, the keys are wrong.

  4. Compare the keys

    In the reCAPTCHA admin console, open the key and check the listed domains, the key type (v2 checkbox, v2 invisible, v3) and that it matches the site key in your form settings.

What the visitor experiences

The form looks normal until the check is rejected.

How to fix it

Fix the keys
  1. Open the reCAPTCHA admin console

    Go to google.com/recaptcha/admin and sign in with the Google account that owns the key. If you cannot find the key, ask whoever built the site which account was used.

  2. Add your domains

    Open the key's settings and add each domain the form runs on, without https:// or a path, for example example.com. Adding a domain also covers its subdomains, such as www, in the standard setup. Add any separate domain used for landing pages.

  3. Check the key type

    A v2 checkbox key will not work as v3, and the reverse. If your form plugin expects another version, create a new key of the right type.

  4. Paste both keys again

    Copy the site key and secret key into your form settings. Make sure there are no spaces or line breaks, and that you did not swap them.

  5. Clear caches

    Purge your page cache and CDN so the page serves the updated site key.

Where to paste the keys
  1. Find the form plugin's reCAPTCHA settings

    Contact Form 7: Contact > Integration > reCAPTCHA. WPForms: WPForms > Settings > CAPTCHA. Gravity Forms: Forms > Settings > reCAPTCHA. Elementor Pro: Elementor > Settings > Integrations. Paste the matching version's keys.

  2. Save and purge cache

    Clear your caching plugin and any CDN, then reload the form.

reCAPTCHA v2 widget: the site key must be registered for this domainhtml
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<form method="post" action="/contact">
  <!-- your fields -->
  <div class="g-recaptcha" data-sitekey="YOUR_SITE_KEY"></div>
  <button type="submit">Send</button>
</form>

How to confirm it's fixed

Confirmation checks
  • The reCAPTCHA widget loads with no error message on the live domain, with and without www
  • The browser console shows no reCAPTCHA errors
  • A real test submit shows the success message or thank-you page
  • The test lead arrives in the inbox and the CRM
  • The check also passes on mobile

How to prevent it happening again

Habits that avoid a repeat
  • Add every domain to the key before launch, including www, staging and landing page domains
  • Add reCAPTCHA keys to your site migration checklist
  • Record which Google account owns the keys
  • Use separate keys for staging and production
  • Test a real submit after every domain, theme or plugin change
  • Run a scheduled form test so a failure is flagged within hours, not weeks

How FunnelGuard handles this

FunnelGuard detects this today. A robot visitor opens your form on a schedule, fills it in and submits it, like a real customer. When the keys are invalid, the submit fails or an error appears, and that is flagged as a failed step.

The failure is re-checked from a second region before one alert goes out by email, Slack, Teams, WhatsApp, webhook or PagerDuty. The alert includes a screenshot and a likely cause. FunnelGuard does not bypass CAPTCHAs or bot protection, so it flags the failed submit and does not claim to know every cause. The Free plan covers 1 site and 2 journeys with daily checks and no card.

Questions people ask

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

The domain the form is on is not registered for that reCAPTCHA site key. Add the domain in the reCAPTCHA admin console under the key's settings, then reload the page and clear caches.

How do I add a domain to my reCAPTCHA key?

Sign in at google.com/recaptcha/admin, open the key, and add the domain in its settings without https:// or a path. Save, then reload your form. Changes usually apply quickly.

Why does reCAPTCHA work on staging but not on my live site?

The key was probably registered only for the staging domain. Add the live domain to the key, or create a separate key for production and paste both of its keys into your form settings.

Can I use a reCAPTCHA v2 key for v3?

No. Keys are created for one type, and a v2 key will not work as v3 or the reverse. Check the key type in the admin console and create a new key if your plugin expects another version.

Do I need to add www as well as the root domain?

Add the root domain, for example example.com. In the standard setup, subdomains such as www are covered by it. Test both versions anyway, and add any separate domains you use for landing pages.

Why does my form fail even though the widget loads?

The site key may be valid while the secret key is wrong, swapped or has a stray space. The server check then fails after the visitor submits. Paste both keys again from the same key pair.

How do I know if reCAPTCHA is stopping my leads?

Submit your own form on the live site and watch for an error or a stalled submit. If you do not get the test email, check the browser console. An automated form check can alert you when a submit fails.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: Submit fails / error shown.

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.