Google Recaptcha Generate Site Key

Sign in to Google with the account, and go to the My reCAPTCHA page. You will see a simple registration form like the following: My reCAPTCHA page. Choose reCAPTCHA v3 from type options, and enter the domain of the website in the Domains field. After you register a website, you will get the site key and secret key for the site. Site details. Oct 20, 2018 In this tutorial, I will show you how to get a Google reCAPTCHA key. Firstly, please go to this link. Google will generate two keys: Site Key and Secret Key.

  • Hi,

    I was trying to fix forms of a website that belongs to my student company to avoid spam, and with that I was trying to get the recaptcha v2 key right. But all I got was “ERROR for site owner: Invalid site key”, I even tried to generate new keys and none of it worked. I can’t think of any ‘former’ keys that exist, if that is the reason of this error. I don’t know how to fix this, as I’ve done what other people were recommended to do with an error like this.

    The page I need help with: [log in to see the link]

  • Hi @ethanchoi ,
    I had the same problem but now it’s solved. Your solution works very well.
    Thank you very much for your support.

    I’m the site owner and now logging into: domain/wp-login.php I get the dreaded “ERROR for site owner: Invalid site key”.
    I’m unable to login as Admin in order to change the reCaptcha secret and site keys. Any suggestions how I can get to the Admin Dashboard and change the site keys? Microsoft office professional plus 2013 product key generator download. Perhaps through the database?

    Was able to go to hosting services File Manager and deleted the Google reCapthca from the wp-content/plugins folder. I was then able to log into Admin area.

    Will now review the documentation instructions!!

    • This reply was modified 1 year ago by .
    • This reply was modified 1 year ago by .

    Have’s another one for you!
    Was getting the same error messages -“ERROR for site owner: Invalid site keyâ€x9D
    I am sure there are many reasons, but after spending way too many hours changing things, I wondered if I was using the right email address to register for the reCAPTCHA Keys?
    The site had one Email but Google had one with another, ha I said!
    Entered the email associated with the site to setup the reCAPTCHA.
    It worked.
    There may be other reasons, here is one. See if it works for you.

    Thank you @ethanchoi – it worked! I really appreciate your support and assistance.

    WebNut, thank you for your suggestion.

    Thanks to you, I checked and saw I have 2 Google accounts with 2 different email addresses. Although I haven’t quite figured out how to get the correct one working, I now see that the email address/Google account is what’s causing my site key error.

    Now to try and figure out how to get it all working again! Sigh.

    Linda

    Will do. Thanks, Ethan. If I can’t get the site key to work, I will create a new post. I suspect, however, it’s my issue with Google Analytics and not yours with your plugin!

    Linda

  • The topic ‘ReCaptcha error: “ERROR for site owner: Invalid site key”’ is closed to new replies.

This page explains how to display and customize the reCAPTCHA v2 widget on your webpage.

To display the widget, you can either:

  • Automatically render the widget or

See Configurations to learn how to customize your widget. For example, you may want to specify the language or theme for the widget.

See Verifying the user's response to check if the user successfully solved the CAPTCHA.

Automatically render the reCAPTCHA widget

The easiest method for rendering the reCAPTCHA widget on your page is to includethe necessary JavaScript resource and a g-recaptcha tag. The g-recaptcha tagis a DIV element with class name g-recaptcha and your site key in thedata-sitekey attribute:

The script must be loaded using the HTTPS protocol and can be included from anypoint on the page without restriction.

Explicitly render the reCAPTCHA widget

Deferring the render can be achieved by specifying your onload callback functionand adding parameters to the JavaScript resource.

  1. Specify your onload callback function. This function will get called whenall the dependencies have loaded.

  2. Insert the JavaScript resource, setting the onload parameter to the nameof your onload callback function and the render parameter to explicit.

    When your callback is executed, you can call the grecaptcha.render methodfrom the JavaScript API.

    Your onload callback function must bedefined before the reCAPTCHA API loads. To ensure there are no raceconditions:
    • Order your scripts with the callback first, and then reCAPTCHA
    • Use the async and defer parameters in the `script` tags

Configuration

JavaScript resource (api.js) parameters

ParameterValueDescription
onloadOptional. The name of your callback function to be executed once all the dependencies have loaded.
renderexplicit
onload
Optional. Whether to render the widget explicitly. Defaults to onload, which will render the widget in the first g-recaptcha tag it finds.
hlSee language codesOptional. Forces the widget to render in a specific language. Auto-detects the user's language if unspecified.

g-recaptcha tag attributes and grecaptcha.render parameters

g-recaptcha tag attributegrecaptcha.render parameterValueDefaultDescription
data-sitekeysitekeyYour sitekey.
data-themethemedark lightlightOptional. The color theme of the widget.
data-sizesizecompact normalnormalOptional. The size of the widget.
data-tabindextabindex0Optional. The tabindex of the widget and challenge. If other elements in your page use tabindex, it should be set to make user navigation easier.
data-callbackcallbackOptional. The name of your callback function, executed when the user submits a successful response. The g-recaptcha-response token is passed to your callback.
data-expired-callbackexpired-callbackOptional. The name of your callback function, executed when the reCAPTCHA response expires and the user needs to re-verify.
data-error-callbackerror-callbackOptional. The name of your callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored. If you specify a function here, you are responsible for informing the user that they should retry.

JavaScript API

MethodDescription
grecaptcha.render(
parameters
)
Renders the container as a reCAPTCHA widget and returns the ID of the newly created widget.
container
The HTML element to render the reCAPTCHA widget. Specify either the ID of the container (string) or the DOM element itself.
parameters
An object containing parameters as key=value pairs, for example, {'sitekey': 'your_site_key', 'theme': 'light'}. See grecaptcha.render parameters.
grecaptcha.reset(
)
Resets the reCAPTCHA widget.
opt_widget_id
Optional widget ID, defaults to the first widget created if unspecified.
grecaptcha.getResponse(
opt_widget_id
)
Gets the response for the reCAPTCHA widget.
opt_widget_id
Optional widget ID, defaults to the first widget created if unspecified.

Examples

Recaptcha V2 Site Key

Explicit rendering after an onload callback

Google Recaptcha Generate Site Keyboard

Explicit rendering for multiple widgets