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.
- Ad or search clickVisitor lands on the page
- Fills in formFields completed
- reCAPTCHA checkInvalid domain or bad key
- Form submittedNever sent
- 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.
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
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.
Submit a test lead
Fill in every field, send it, and see whether you get a success message and an email or CRM entry.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Paste the new keys
Enter the site key and secret key for the right version, save, and clear any page cache.
Check security plugins
If a separate plugin (for example a login or anti-spam plugin) also loads reCAPTCHA, update its keys too.
Use the built-in spam protection
Shopify's own forms use its built-in protection and need no keys from you.
Check third-party form apps
If a form app or custom section embeds reCAPTCHA, open the app's settings, replace the keys and save.
Check theme code
Search the theme for 'g-recaptcha' or 'data-sitekey' under Online Store > Themes > Edit code and replace outdated keys.
Look for custom HTML tags
If a Custom HTML tag loads reCAPTCHA, open it in the workspace and replace the site key.
Preview and publish
Use Preview to confirm the widget renders on the live domain, then submit the container.
Open Site settings
Go to Site settings > Forms and find the reCAPTCHA section. Enter the site key and secret key for the version you created.
Publish
Publish the site to all domains so the new keys are live.
Check custom code and embeds
Native GoHighLevel forms have their own spam protection. If you embedded a custom form with reCAPTCHA in a funnel step's custom code, replace the site key there.
Add the custom domain
If you moved to a custom domain, add that domain to your reCAPTCHA key.
Use the built-in option
Wix forms have their own spam protection you can switch on in the form settings. They don't use your own reCAPTCHA keys.
Check embedded code
If you added reCAPTCHA through an HTML embed, replace the site key in that embed and make sure your domain is allowed.
Use the built-in option
Squarespace forms use its own spam protection. You don't enter keys for those.
Check Code Injection and embeds
If you added reCAPTCHA in a Code Block or under Settings > Advanced > Code Injection, replace the site key there.
Replace the site key in the front end
Update the data-sitekey attribute or the render() call with the new site key.
Replace the secret key on the server
Update the secret used when calling https://www.google.com/recaptcha/api/siteverify. Keep it out of public code.
Handle failures clearly
Log the error-codes array from the siteverify response so a bad key shows up in your logs.
<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>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".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
- 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
- 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.
Day 0
Site moves to a new domain. Keys still list only the old one.
Day 0
Form shows 'Invalid domain for site key'. Submissions stop.
Day 1-14
Traffic keeps arriving. Nobody sees an error because the page loads.
Day 15
Someone notices the lead count has dropped and finds the cause.
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.
Related issues
- OPS-100Cloudflare/WAF blocks real visitors (challenge loops)Fix guide
- OPS-105CAPTCHA on every page view (Under Attack mode left on)Fix guide
- OPS-110Cached form nonce expired (form rejects submissions)Fix guide
- OPS-103WAF rule blocking form submissions with certain wordsFix guide
- OPS-101Bot Fight Mode blocking checkout or form postsFix guide
- OPS-122Allow-list missing for monitoring IPs (false blocks)Fix guide