Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reCAPTCHA ERROR: Invalid domain for site key

Tags:

html

recaptcha

I have implemented my reCAPTCHA in line with as is shown in the example.

I have this script in the head tag:

<script src="https://www.google.com/recaptcha/api.js"></script> 

In my form in HTML I have:

<div class="g-recaptcha" data-sitekey="my public sitekey here"></div> 

But when I load the form I get this error:

ERROR: Invalid domain for site key

I have confirmed that this is the correct site key for my domain.

The code is currently in a subdomain so I thought maybe that was the problem so I also added the subdomain to the Google reCAPTCHA admin but still get the error.

The exact same code works 100% in a different domain (with a key specific to that domain).
What could be the problem?

like image 903
BlessedHIT Avatar asked Jun 09 '15 14:06

BlessedHIT


People also ask

How do I fix invalid reCAPTCHA?

There are a few steps you can take to improve your experience: Make sure your browser is fully updated (see minimum browser requirements) Check that JavaScript is enabled in your browser. Try disabling plugins that might conflict with reCAPTCHA.

What does invalid domain mean?

A malformed or invalid domain is a domain name located in an email address that has an error in spelling or syntax. These types of errors specify domains that do not exist and result in undeliverable emails. Examples of malformed and invalid domains include: [email protected]. [email protected].


2 Answers

First of all, the keys are managed at https://www.google.com/recaptcha/admin#list

I ran into this error because I'm using the same key on a few different domains and I had forgotten to add one of the domains to the key.

After adding my site it took a minute or two (most likely because of cache) for things to work normally again.

like image 38
kqw Avatar answered Oct 07 '22 00:10

kqw


In case someone has a similar issue. My resolution was to delete the key that was not working and got a new key for my domain. And this now works with all my sub-domains as well without having to explicitly specify them in the recaptcha admin area.

like image 71
BlessedHIT Avatar answered Oct 06 '22 23:10

BlessedHIT