Hello Guys, Today in the tutorial, we will learn how to add Google reCAPTCHA to WordPress comments without plugin. If your blog also gets spam comments and through this, your spam score is increased and you are upset due to this, then you will not get any trouble because today I am going to tell you a solution through which this problem can be solved. Its solution is that we add Google reCAPTCHA to WordPress comments without plugin in your blog.
So let’s start
What is Google reCAPTCHA?
reCAPTCHA is a free anti-spam service provided by Google. It is easy to do it, it is also effective and at the same time it is even easier to implement it. It is best done to him for the API of the captcha. If you want to know more about it, then click on this link https://www.google.com/recaptcha/intro/.
This method has been used on the latest version of WordPress and has also been used in many themes such as GeneratePress, Twenty Seventeen theme, etc.
Steps to add Google reCAPTCHA to WordPress comments.
Step 1: Go to https://www.google.com/recaptcha/admin#list and register your website.
Step 2: View the “Site key” and “Secret key” which will be used later in the code.
Step 3: Edit single.php from your theme folder (in my example /wp-content/themes/generatepress) and add the following code before get_header();
Step 4: Edit functions.php, add the code from below with your site_key (line 5) and secret_key (line 15).
No step five, that’s it!
I hope this solution or method will help you to get the desired result.
If you have any feedback/comments, please feel to comment or contact us.