Google reCAPTCHA It is a security service that prevents fraud and abuse on your website.
Starting with Magento 2.3.x, Google reCaptcha is included by default in the Magento Core, meaning that it only needs to be configured in order to be ready for use. To enable and configure it, follow the steps below:
In order to enable the reCAPTCHA from Google, you need a pair of API keys.
Important: Please note, for reCAPTCHA to be enabled, the valid "Google API Website Key" and "Google API Secret Key" fields are required.
Before you start the setup and generate the API keys you need to know what type of reCAPTCHA you want to use, there are 3 options available:
- reCAPTCHA v2 ("I am not a robot")
- reCAPTCHA v2 Invisible
- reCAPTCHA v3 Invisible
To set it up, first, you have to go to Google reCAPTCHA and generate the reCAPTCHA keys.
After you generate the API keys for the reCAPTCHA type that you choose for your site, follow these steps to set it up in Magento:
Set reCAPTCHA for Magento Admin Store
To set it up, go to Admin -> Stores -> Settings -> Configuration -> Scope: set it to Default Config.
-> Security -> Google reCAPTCHA Admin Panel:

1. Set up reCAPTCHA v2 ("I am not a robot")
a. Google API Website Key Add the key that you created for this reCAPTCHA type.
b. Google API Secret Key Add the secret key that is associated with your Google reCAPTCHA account.
c. Size Set the size of the box that you want
- Normal
- Compact
d. Theme
- Light Theme
- Dark Theme
e. Language Code Optional. Forces the widget to render in a specific language. Auto-detects the user's language if unspecified. See supported Language Codes.

2. Set up reCAPTCHA v2 Invisible
a. Google API Website Key Add the key that you created for this reCAPTCHA type
b. Google API Secret Key Add the secret key that is associated with your Google reCAPTCHA account.
c. Invisible Badge Position Set where you want the reCAPTCHA badge to appear
- Inline
- Bottom Right
- Bottom Left
d. Theme
- Light Theme
- Dark Theme
e. Language Code Optional. Forces the widget to render in a specific language. Auto-detects the user's language if unspecified. See supported Language Codes.

3. Set up reCAPTCHA v3 Invisible
a. Google API Website Key Add the key that you created for this reCAPTCHA type.
b. Google API Secret Key Add the secret key that is associated with your Google reCAPTCHA account.
c. Minimum Score Threshold This identifies when a user could be a bot, 0.0 is likely a bot, the default is set to 0.5 and 1 is a normal user
d. Invisible Badge Position Set where you want the reCAPTCHA badge to appear
- Inline
- Bottom Right
- Bottom Left
e. Theme
- Light Theme
- Dark Theme
f. Language Code Optional. Forces the widget to render in a specific language. Auto-detects the user's language if unspecified. See supported Language Codes.

4. Set up reCAPTCHA Failure Messages
a. reCAPTCHA Validation Failure Message You can set your own message if verification fails, or you can leave it on the Default message.
b. reCAPTCHA Technical Failure Message You can set your own message if something goes wrong with the reCAPTCHA verification, or you can leave it on the Default message.

5. Admin Panel Set up where reCAPTCHA to appear on the Login Page or Forgot Password page.
a. Enable for Login:
- No
- reCAPTCHA v2 ("I am not a robot")
- reCAPTCHA invisible
- reCAPTCHA v3
b. Enable for Forgot Password:
- No
- reCAPTCHA v2 ("I am not a robot")
- reCAPTCHA invisible
- reCAPTCHA v3

Set reCAPTCHA for the Storefront
To set it up, go to Admin -> Stores -> Settings -> Configuration -> Scope: set it to Default Config.
-> Security -> Google reCAPTCHA Storefront:
1. The settings are the same as for the Admin Store above for reCAPTCHA.

2. For Storefront you have these options:

- No
- reCAPTCHA v2 ("I am not a robot")
- reCAPTCHA invisible
- reCAPTCHA v3
b. Enable for Forgot Password
- No
- reCAPTCHA v2 ("I am not a robot")
- reCAPTCHA invisible
- reCAPTCHA v3
c. Enable for Create New Customer Account
- No
- reCAPTCHA v2 ("I am not a robot")
- reCAPTCHA invisible
- reCAPTCHA v3
d. Enable for Edit customer Account
- No
- reCAPTCHA v2 ("I am not a robot")
- reCAPTCHA invisible
- reCAPTCHA v3
e. Enable for Contact Us
- No
- reCAPTCHA v2 ("I am not a robot")
- reCAPTCHA invisible
- reCAPTCHA v3
f. Enable for Product Review
- No
- reCAPTCHA v2 ("I am not a robot")
- reCAPTCHA invisible
- reCAPTCHA v3
g. Enable for Newsletter Subscription
- No
- reCAPTCHA v2 ("I am not a robot")
- reCAPTCHA invisible
- reCAPTCHA v3
h. Enable for Send To Friend
- No
- reCAPTCHA v2 ("I am not a robot")
- reCAPTCHA invisible
- reCAPTCHA v3
i. Enable for PayPal PayflowPro payment form
- No
- reCAPTCHA v2 ("I am not a robot")
- reCAPTCHA invisible
- reCAPTCHA v3
Click Save Config after you are done.
The Google reCaptcha should now be enabled and configured on your store and helping keep bots away
If you want to set up CAPTCHA on Magento 2, follow the steps in this article here
Comments
0 comments
Please sign in to leave a comment.