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?
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.
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].
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With