Skip to content
FunnelGuard

Fix guide by FunnelsGuard

reCAPTCHA keys invalid for domain: how to find and fix it

CNV-369High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

reCAPTCHA is Google's tool that tells humans from bots on forms. When you create it, you get a site key (public, in your page) and a secret key (private, used by your server to check the result). Each key pair is registered for a list of domains.

If the page that shows the widget is on a domain not in that list, Google rejects the request. The widget shows a red 'ERROR for site owner: Invalid domain for site key' message, or does not render properly. The browser console may also show a reCAPTCHA error. Often the form then cannot be sent, or the server rejects the missing token.

Typical reasons the domain does not match
  • The site moved to a new domain or was rebranded
  • The domain list has example.com but the form is on www.example.com, or the other way round (subdomains are covered when you list the parent domain, but check your setup)
  • A staging, preview or builder domain (for example a temporary Webflow or Wix address) uses production keys
  • Keys were copied from another client's or another site's project
  • A landing page tool or funnel builder serves the form on a custom domain you never added
  • The key type does not match the code: a v2 key used with v3 code, or the reverse
  • Domain validation was turned off or changed in the admin console

Why it costs you leads or sales

The page still loads, so nothing looks wrong in your analytics at first. But visitors who fill in the form cannot finish it, or their submission is rejected after they press send. Paid traffic keeps arriving and the lead step quietly stops working.

Where the funnel breaks
  1. Ad clickVisitor lands on your page
  2. Form loadsFields are filled in
  3. reCAPTCHA checkInvalid domain for site key
  4. Lead email and CRMNever receives the lead
  5. Conversion tagNever fires on a thank-you page

The domain check fails before the form can send, so everything after it is lost.

Leads per week before and after the keys brokeExample numbers
Leads per week before and after the keys broke (example)Before the domain change: 40 leads; After the domain change: 2 leads01531402Before the domain cha…After the domain chan…leads

Example: a site that gets 40 leads a week drops to near zero after a domain change, while ad spend stays the same.

How to check if your site has it

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

    Use the real public URL, on the exact domain visitors use (with or without www).

  2. Look at the reCAPTCHA widget

    A red message reading 'ERROR for site owner: Invalid domain for site key' confirms it. A missing widget needs the next step.

  3. Open the browser console

    Press F12 (or Cmd+Option+J on Mac Chrome) and open the Console tab. Look for reCAPTCHA errors such as 'Invalid domain for site key'.

  4. Find the site key in the page source

    Search the source for data-sitekey or for api.js?render= and note the key.

  5. Compare it with the admin console

    Open google.com/recaptcha/admin, find the key and check its Domains list against the domain in your address bar.

  6. Try the other domain variants

    Check www and non-www, and any funnel or checkout subdomains that host a form.

What a visitor sees

The form looks normal until the reCAPTCHA check runs and rejects the domain.

How to fix it

There are two ways to fix it. Either add the missing domain to the existing key, or create a new key pair for the right domain and replace both keys wherever they are used. Use the first option when the keys are correct and only the domain is missing.

Add the domain to your reCAPTCHA key
  1. Sign in to the admin console

    Go to google.com/recaptcha/admin with the Google account that owns the key. If you do not know which account, ask whoever set the site up.

  2. Select the site

    Pick the key matching the site key in your page source.

  3. Open settings

    Click the gear icon for Settings and find the Domains section.

  4. Add the domain

    Enter the domain without https:// or a path, for example example.com. Add every domain that hosts the form.

  5. Save and reload

    Save, then hard-refresh the form page. Changes can take a few minutes.

If you need to replace the keys on your platform
  1. Find where the keys live

    Depending on your form plugin this is in Contact Form 7 > Integration, WPForms > Settings > CAPTCHA, Gravity Forms > Settings > reCAPTCHA, or a dedicated reCAPTCHA plugin.

  2. Paste the new site and secret keys

    Make sure the key type (v2 checkbox, v2 invisible or v3) matches the type selected in the plugin, then save.

  3. Clear caches

    Purge your caching plugin and CDN so the old site key is not served.

reCAPTCHA v2 checkbox with a site keyhtml
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<form action="/contact" method="POST">
  <!-- other fields -->
  <div class="g-recaptcha" data-sitekey="YOUR_SITE_KEY"></div>
  <button type="submit">Send</button>
</form>

How to confirm it's fixed

Confirm after the change
  • The widget loads on the live domain with no red error message
  • The browser console shows no reCAPTCHA errors
  • A real test submission goes through and shows your thank-you message or page
  • The test lead arrives in your inbox and your CRM
  • The conversion tag fires on the thank-you step (check in GA4 or Tag Assistant)
  • The same checks pass on www and non-www and on any funnel subdomain

How to prevent it happening again

Habits that stop it recurring
  • Add every domain to the reCAPTCHA key before you launch or move a site
  • Record which Google account owns each key and who else has access
  • Keep separate keys for staging and production
  • Add a reCAPTCHA check to your go-live and domain-change checklists
  • After any migration, submit the live forms yourself the same day
  • Run an automated check on your forms so a break is caught in hours, not weeks
Domain list in the admin console

Before

  • Key lists only old-site.com
  • Form runs on new-site.com
  • Widget shows 'Invalid domain for site key'
  • Submissions fail

After

  • Key lists old-site.com and new-site.com
  • Widget loads normally
  • Submissions reach inbox and CRM
  • Conversion tags fire

How FunnelGuard handles this

FunnelGuard detects this issue today. A robot visitor runs your real lead-form journey on a schedule, from the EU or the US. It opens the form, fills it in and tries to submit. When the reCAPTCHA domain error appears, FunnelGuard picks up the console errors and the blocked form, and the step fails.

Questions people ask

Why does reCAPTCHA say 'Invalid domain for site key'?

The site key in your page is not registered for the domain the form is on. Google checks the domain list of the key and refuses the request when it does not match. Add the domain in the reCAPTCHA admin console or use the correct keys.

How do I add a domain to my reCAPTCHA key?

Sign in at google.com/recaptcha/admin, select your site, click the gear icon for Settings and add the domain under Domains. Enter it without https:// or a path, save, then reload the form page.

Why did my reCAPTCHA stop working after I changed domain?

Your keys are still registered for the old domain. The new domain is not on the key's list, so Google rejects the check. Add the new domain to the existing key or create new keys and replace both site and secret keys.

Does reCAPTCHA work on localhost or a staging site?

Only if that domain is on the key's list. Many people add localhost or a staging domain to a separate key made for testing, so the production key stays limited to the live domain.

Do I need to add www and non-www separately to reCAPTCHA?

Listing the parent domain, such as example.com, normally covers its subdomains, including www. Test both versions after saving, because the exact behaviour depends on how the key was set up.

Will an invalid reCAPTCHA key stop my form emails?

Yes, often. If the widget cannot validate, the visitor cannot send the form or the server rejects the missing token, so no email or CRM entry is created. Submit a real test to be sure.

How do I know if my form is blocked by reCAPTCHA right now?

Open the live form in a private window, look for a red reCAPTCHA error and check the browser console. An automated form check, such as FunnelGuard's, can run the journey on a schedule and alert you with a screenshot if it fails.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: console errors / form blocked.

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.