IM-BASE IM-BASE

Contact Us

How to Add Google reCAPTCHA v2 and v3 to IM Mail Form

How to Add Google reCAPTCHA v2 and v3 to IM Mail Form

Spam submissions can be a frustrating problem for any website with a contact form. Automated bots may submit unwanted messages, fill your inbox with spam, or abuse your forms.

Google reCAPTCHA helps protect your WordPress forms by distinguishing legitimate visitors from automated traffic.

With IM Mail Form, you can add Google reCAPTCHA v2 or v3 to your contact forms without writing any code. Both options are included in the free Core plugin.

In this tutorial, we’ll explain the differences between reCAPTCHA v2 and v3 and walk through the setup process.

1. What Is Google reCAPTCHA?

Google reCAPTCHA is a security service designed to help websites detect automated activity.

IM Mail Form supports two versions.

Google reCAPTCHA v2

reCAPTCHA v2 uses the familiar “I’m not a robot” checkbox.

Visitors may occasionally be asked to complete an image challenge to verify that they are human.

It’s a straightforward option when you want visitors to see that your form is protected.

Google reCAPTCHA v3

reCAPTCHA v3 works differently.

Instead of displaying a checkbox or asking visitors to complete a challenge, it analyzes interactions and assigns a risk score.

The score ranges from 0.0 to 1.0:

  • 1.0 — More likely to represent legitimate interaction
  • 0.0 — More likely to represent automated or suspicious activity

IM Mail Form checks the returned score against the threshold configured by the website administrator.

Because v3 does not require visitors to interact with a checkbox, it can provide a smoother form submission experience.

Which Version Should You Choose?

Feature reCAPTCHA v2 reCAPTCHA v3
Verification Checkbox and possible challenge Invisible score-based analysis
User interaction Sometimes required No challenge required
Risk score threshold Not applicable Configurable
Best suited for Visible verification Smooth user experience

Both versions provide an additional layer of protection. Choose the option that best fits your website and visitors.

2. Before You Begin

Make sure you have:

  • A WordPress website with IM Mail Form installed and activated
  • Administrator access to WordPress
  • A Google account
  • A domain where your contact form will be displayed

You will also need a reCAPTCHA Site Key and Secret Key for the version you want to use.

If you haven’t installed IM Mail Form yet, you can download it from WordPress.org.

3. Register Your Website with Google reCAPTCHA

Step 1: Open the reCAPTCHA Admin Console

Visit the Google reCAPTCHA Admin Console and sign in with your Google account.

Depending on your account and setup, Google may ask you to select or create a Google Cloud project.

Step 2: Choose Your reCAPTCHA Version

Enter a label to identify your website.

Next, select the type of reCAPTCHA you want to use:

  • Challenge (v2) — For the “I’m not a robot” checkbox
  • Score based (v3) — For invisible, score-based verification

Google may use the terms Checkbox and Score-based in the Google Cloud console.

Make sure the selected key type matches the version you intend to configure in IM Mail Form.

Important: reCAPTCHA v2 Checkbox and reCAPTCHA v3 require different keys. If you want to use both versions, register a separate key for each.

Step 3: Add Your Website Domain

Enter the domain where IM Mail Form will be used.

For example:

example.com

You do not need to include https:// or a page path.

If you use a separate staging website, consider creating separate keys for your staging and production environments.

Step 4: Create and Copy Your Keys

Complete Google’s registration process.

You will need two values:

Site Key

A public key used by the reCAPTCHA JavaScript running in the visitor’s browser.

Secret Key

A private key used by your server to verify reCAPTCHA responses with Google.

Keep the Secret Key private. Do not include it in public HTML, JavaScript, or shared screenshots.

If you manage your keys through Google Cloud, the Secret Key may appear under the key’s integration settings as a legacy secret key for third-party plugins.

See Google’s official key creation guide for the current registration process.

4. Configure reCAPTCHA in IM Mail Form

Once you have your keys, return to your WordPress dashboard.

Step 1: Open the CAPTCHA Settings

Navigate to IM Mail Form’s site-wide CAPTCHA settings.

IM Mail Form allows you to register CAPTCHA credentials centrally and select the protection method separately for each form.

Step 2: Enter Your reCAPTCHA Keys

Locate the settings for the version you registered.

For reCAPTCHA v2, enter the corresponding Site Key and Secret Key.

For reCAPTCHA v3, enter the Site Key and Secret Key created for the score-based version.

Save your settings.

Make sure you do not mix v2 and v3 keys, as they are not interchangeable.

Step 3: Enable reCAPTCHA for Your Form

Open the form you want to protect in the IM Mail Form editor.

Find the form’s CAPTCHA settings and select either:

  • Google reCAPTCHA v2
  • Google reCAPTCHA v3

Save the form.

That’s it. IM Mail Form handles loading the appropriate Google reCAPTCHA JavaScript and verifying the response when the form is submitted.

You can choose different CAPTCHA providers for different forms, depending on your requirements.

5. Adjust the reCAPTCHA v3 Score Threshold

If you’re using reCAPTCHA v3, you can configure the minimum score required for a submission to pass verification.

A higher threshold is more restrictive, while a lower threshold is more permissive.

For example, a threshold of 0.5 is a reasonable starting point for many websites, but the appropriate value depends on your traffic and the scores returned by Google.

If legitimate visitors are being rejected, review your threshold and reCAPTCHA activity before making adjustments.

The goal is to reduce automated submissions without unnecessarily blocking real visitors.

This step is not required for reCAPTCHA v2, which uses checkbox-based verification.

6. Test Your Contact Form

After configuring reCAPTCHA, always test the form on your actual website.

Testing reCAPTCHA v2

Open the page containing your contact form.

You should see the reCAPTCHA checkbox.

Complete the verification, fill out the form, and submit it.

If everything is configured correctly, the form should proceed through its normal submission process.

Testing reCAPTCHA v3

Open the page containing your contact form.

You will not see an “I’m not a robot” checkbox. reCAPTCHA v3 runs without requiring an interactive challenge.

Fill out and submit the form normally.

IM Mail Form verifies the token and checks Google’s score against your configured threshold.

What If Your Form Has a Confirmation Screen?

IM Mail Form supports reCAPTCHA with or without a confirmation screen.

When the confirmation screen is enabled, visitors can review their information before sending it.

reCAPTCHA verification is performed on the final submission, rather than when the visitor first opens the confirmation screen.

This helps ensure verification takes place at the appropriate stage of the submission process.

7. Troubleshooting Common reCAPTCHA Issues

The reCAPTCHA Checkbox Does Not Appear

If you’re using v2 and the checkbox is missing, check that:

  • You selected Google reCAPTCHA v2 for the form.
  • The v2 Site Key and Secret Key are configured.
  • Your website domain is registered with Google.
  • JavaScript optimization, caching, or security settings are not blocking Google’s reCAPTCHA script.

Remember that reCAPTCHA v3 does not display a checkbox.

Google Reports an Invalid Site Key

Make sure the Site Key matches the selected reCAPTCHA version.

A v3 key cannot be used as a v2 checkbox key, and vice versa.

Also check that the key is valid for your website’s domain.

Verification Fails During Submission

Check that the Site Key and Secret Key belong to the same registration.

If a form has been left open for a long time, the reCAPTCHA token may have expired. Reload the page and try again.

Google reCAPTCHA tokens are short-lived and can only be verified once.

If the issue persists, check for JavaScript errors, blocked Google requests, or conflicting optimization plugins.

Legitimate Users Are Rejected by reCAPTCHA v3

Review your configured score threshold.

A threshold that is too restrictive can reject legitimate submissions.

You can also review activity in Google’s reCAPTCHA management interface to better understand the scores being returned.

Does reCAPTCHA Send Information to Google?

Yes.

When reCAPTCHA is enabled for a form, the visitor’s browser loads Google’s reCAPTCHA JavaScript. IM Mail Form also sends the verification token and, when available, the visitor’s IP address to Google’s verification service on final submission.

Review Google’s Privacy Policy and Terms of Service, and make sure your website’s privacy disclosures reflect the external services you use.

8. Summary

Google reCAPTCHA adds an extra layer of protection against spam and automated form submissions.

With IM Mail Form, you can:

  • Use reCAPTCHA v2 with a visible checkbox.
  • Use reCAPTCHA v3 for invisible, score-based verification.
  • Configure CAPTCHA credentials centrally.
  • Choose a CAPTCHA provider individually for each form.
  • Use CAPTCHA with or without a confirmation screen.
  • Benefit from built-in Honeypot, Time Trap, and Rate Limit protection alongside optional CAPTCHA.

You don’t need to write code or install an additional CAPTCHA plugin.

Try IM Mail Form

IM Mail Form is a free WordPress contact form plugin designed for website creators, developers, and site owners.

It includes customizable fields, email notifications, automatic replies, confirmation screens, file uploads, email history, and built-in spam protection.

Start building secure WordPress contact forms today.

Learn more about IM Mail Form

Download IM Mail Form for free on WordPress.org