How to Use the Recaptcha Module in Drupal 8
The reCAPTCHA module for Drupal 8 integrates the reCAPTCHA service provided by Google with your Drupal site. This service provides additional protection by detecting if the user accessing your site is a real person or a robot.
Keep reading to learn how to use this module!
Step #1.- Install the Required Modules
- Open the terminal application of your PC.
- Type: composer require drupal/recaptcha
- Click Extend.
- Scroll down and enable Captcha, Image Captcha, and reCAPTCHA.
- Click Install
Step #2.- Configure the Module
- Click Configuration > CAPTCHA module settings > reCAPTCHA.
- Click the link register to reCAPTCHA.
- Select v2 of reCAPTCHA.
- Enter a valid domain name (this will not work on a local installation).
- Accept the Terms.
- Click Send / Ok.
You will get the Site Key and Secret Key. Paste them on the reCAPTCHA settings of your Drupal backend accordingly.
- Scroll down and click Save configuration.
- Click CAPTCHA Settings.
- Change the default challenge type to reCAPTCHA.
- Leave the other defaults.
- Click Save configuration.
Note: The image captcha module provides those “old-fashioned” challenges with an alphanumeric image.
- Click the Form settings tab.
- Enable the Contact Message Feedback Form.
- Click Edit.
- Add a proper name.
- Select the reCAPTCHA challenge type.
- Click Save.
Step #3.- Test the Contact Form
- Use another browser to access the site as an anonymous user.
- Navigate to yoursite/contact/feedback.
You should see the well-known “I’m not a robot checkbox”. If you click on it, you will get an image challenge to verify whether the user sending the form is human or not.
I hope you liked this tutorial. Thanks for reading!
Very true, Your content is always informative and I love to read them.
Thanks
Thanks baizid. That’s the main goal of it.
Regards!