We are all familiar with filling in forms online using captchas to prove that we are humans and not robots.
Google offers a free service to protect your website from spam and abuse called reCAPTCHA.
According to Google …
reCAPTCHA uses an advanced risk analysis engine and adaptive CAPTCHAs to keep automated software from engaging in abusive activities on your site. It does this while letting your valid users pass through with ease.
reCAPTCHA offers more than just spam protection. Every time our CAPTCHAs are solved, that human effort helps digitize text, annotate images, and build machine learning datasets. This in turn helps preserve books, improve maps, and solve hard AI problems.contact form
Source: Google reCaptcha
If your WordPress site is getting spammed, you may want to look at adding captcha verification to your forms.
Captchas can be used to protect all WordPress forms on your site, including:
- Login forms
- Registration forms
- Comment forms
- Contact forms
- Password reset forms
In this tutorial, we’ll show you how to add Google reCaptcha verification to forms on your WordPress site.
How To Add Google reCaptcha Security Captchas To WordPress Forms
If you plan to add security captchas to forms on your site without touching code, you will probably want to use WordPress plugins to do this (we’ll look at some plugins that let you easily add captchas to forms on your site later in this tutorial).
Before plugins can display security captchas to your site visitors and users, you will need to register your site with Google’s reCaptcha service and get unique keys that will connect your plugin with the service.
Let’s walk you step-by-step through this process …
First, make sure that you have a Google account and that you’re logged into any of your services (e.g. Gmail, Google AdWords, Google Analytics, etc.), then go to https://www.google.com/recaptcha …
Click on the ‘Get reCAPTCHA’ button …
This will bring up a screen where you can manage your reCAPTCHA keys. This screen will list all the domains you have registered to use the reCaptcha service …
(reCAPTCHA API keys management screen)
In the ‘Register a new site’ section, do the following:
(1) Enter the name of your site or a label that will help you identify the domain you are registering with the service.
(2) Choose the type of reCAPTCHA you want to add to your forms. Typically, for login forms and contact forms using plugins you will use the reCAPTCHA v2 verification type …
Using reCAPTCHA v2 verification will either pass the user immediately (with No CAPTCHA) or require them to validate if they are human or not with additional catcha security challenges.
(3) Enter your domain into the Domains field (e.g. yourdomain.com) …
(4) Access the terms of service checkbox
(5) Click the ‘Register’ button …
(Register a new site to use reCaptcha)
A screen will come up displaying code snippets. Typically, for most applications, all you need are the two keys shown below – (1) Site key and (2) Secret key …
Do not share these keys with anyone else, especially your Secret key.
Copy and paste your reCaptcha keys into a plain text file. You will need these to connect your site with Google’s reCaptcha service …
(Copy and paste your keys into a plain text file)
After installing your reCaptcha plugin, go to the plugin settings section and paste the keys into the corresponding Site Key and Secret Key fields, then save to update your plugin’s settings and authenticate the service …
(Enter your keys into your WordPress plugin’s settings)
Your forms should now display to visitors with the reCaptcha verification feature added …
(A contact form with reCaptcha verification added)
WordPress reCaptcha Plugins
There are a number of reCaptcha plugins you can use with WordPress to protect your forms from spam entries.
You can search for these plugins by going to Plugins > Add New in your WordPress dashboard and typing “captcha” into the keyword search field (if you need help, see our tutorial on installing WordPress plugins) …
(WordPress captcha plugins)
Note: Not all captcha plugins use the Google reCaptcha service. We recommend going through some of the plugins above and installing whichever one best fits your needs.
Congratulations! Now you know how to add Google reCaptcha security captchas to forms in your WordPress site.
"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum