How to Set up Google reCAPTCHA | reCAPTCHA in NopCommerce

·

2 min read

Google reCAPTCHA is a free service from Google that helps protect websites from fraudulent form submissions and bots. Follow these simple steps to set up Google reCAPTCHA for your site.

  1. Sign up for an API key pair for your site. Click here to start the process. or simply search on google: google captcha admin console

  2. Select 'Admin Console' admin console

google-recaptcha-admin.jpg

  1. login with your Gmail account credentials

  2. Click on the plus sign button and configure with project domain

  3. Type your website URL

  4. Select reCAPTCHA v2

  5. Enter your website's URL under 'Domains'

  6. Enter emails of the administrators

  7. Accept reCAPTCHA Terms of Service

image.png

  1. Submit the form. Your API keys will be generated.

image.png recaptcha-key.jpg

In this way, we can configure the captcha.

Now we will see how we can Add Recaptcha in NopCommerce 4.3.

  1. log in as Admin.

  2. Go to Cnfoguration->General settings-> Enable Captcha .

  3. Once you will enable it, some more fields will be there, and from there we can choose Recaptcha type v2 or v3 according to our need.

  4. At Last we just configure the public and secret keys in that section and have to select the pages where we want to configure the Recaptcha for validation like in login, register, contact us, etc page.

image.png No need to write a single line of code. because in NopCommerce the captcha plugin is already installed.

And after all settings, we can see the captcha on our page. Here we have implemented Recaptcha v2

image.png

On login, if you will not tick to the I'm not robot, we get the below error

image.png