Skip to content
Home » Blog » How to add reCAPTCHA to the login page and the comment form

How to add reCAPTCHA to the login page and the comment form

Last updated on November 27th, 2024 at 12:01 pm

How to add reCAPTCHA to login page and comment form

In the previous post, I talked about reCAPTCHA fundamentals and how to set it up with Contact Form 7.

In this post, I’ll talk about how to set up reCAPTCHA for the login page and comment form. I also made an 8-minute video tutorial (with time stamps) on this topic. This video gives you great visual instructions! Now, let’s dive right in.

How to set up reCAPTCHA v2 for the login page and comment form?

Step 1: Go to the reCAPTCHA Admin Panel.

Step 2: Register a new site by:

  • Putting in a label (what you’ll use the reCAPTCHA for, e.g. login form, comment form, etc.). 
  • Selecting “Challenge (v2)” for reCAPTCHA v2.
  • Adding the site domain.

Step 3: Submit. Then you will then receive the site key and secret key.

Step 4: On your WordPress site, install and activate the plugin “Advance Google reCAPTCHA”.

Step 5: Configure the plugin as follows: 

  • On the “CAPTCHA” tab, select Google reCAPTCHA v2.
    • Copy and paste the site key and secret key from the reCAPTCHA panel. Verify the keys.
    • Choose the reCAPTCHA tickbox window and save the changes.
  • On the “Where to Show” tab, leave it as the default setting or enable it for WooCommerce functions if you run a Woo store.

Step 6: Test the CAPTCHA on the login page by logging out of your site. If set up correctly, you’ll see a tickbox asking if you’re a robot under the login form. 

Step 7: Test the CAPTCHA on your comment form by going to your blog post. Similar to the login form, you should see a tickbox under the comment form. After submitting your comment, you’ll be presented with some easy challenges. Once completed, you’ll then be verified, and your comment will be posted.

That’s a wrap for adding reCAPTCHA v2 on your site. Simple enough? If you prefer a more seamless, less disruptive reCAPTCHA, move on to version 3.

How to set up reCAPTCHA v3 for the login page and comment form?

If you change the reCAPTCHA version, you’ll have to register your site on the reCAPTCHA admin panel again. Then, you’ll need to adjust the plugin configuration to accommodate reCAPTCHA v3. Pay attention to the updated steps below:

Step 2: Choose “Score based (v3)” instead of “Challenge (v2)”. 

Step 5: Update the reCAPTCHA plugin with the following:

  • Select Google reCAPTCHA v3.
  • Replace the v2’s keys with v3’s. Verify the keys.
  • Choose the Google reCAPTCHA v3 window and save the changes.

Step 6 – 7: When testing on the login page and comment form, there won’t be any tickbox showing. That’s because the v3 assesses the user’s activities in the background using scores. 

Alright…

That’s how you can add reCAPTCHA v2 and v3 to your site’s login form and comment form to block spam. Pick your desired version. I believe most people prefer v3 because it’s more user-friendly. You can also monitor your reCAPTCHA performance on the reCAPTCHA admin panel.  

Once again, if you’d like to see all these instructions in a more visual format, watch this 8-minute video. I’ve included timestamps to help you navigate. 

Reply to this post if you have any questions about adding reCAPTCHA to your WordPress site 😉

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.