WordPress Tutorials, Tips, and Resources to Help Grow Your Business
Do you want to prevent spam emails from your WordPress contact forms? Have you been getting spam form submissions? A lot of those spam submissions are automated with bots. In this article, we will show you how to add reCAPTCHA in Contact Forms to stop spam.
Why Use reCAPTCHA?
1. Blocking spam – By verifying that a human is submitting a form, all automated spam attempts are blocked.
2. Easy for users – Originally CAPTCHA was created to do two things at the same time. It helped machines translate non-digital books while fighting spam. But, the jumbled text was difficult for users to answer correctly.
Google has improved their CAPTCHA tool, reCAPTCHA v2.0, to be much easier for users.
Now instead of entering text, users can just put their mouse over the checkbox and the tool understands that this is not an automated spam bot. This is much easier for users to prove that they are not robots.
Add reCAPTCHA in Contact Forms
Next, you need to configure reCAPTCHA settings within WordPress. Go to WPForms » Settings.
On the settings page, you will find the reCAPTCHA section.
reCAPTCHA is a service provided by Google. It is free, but requires a site key and secret key. You can easily generate those keys for your site by clicking on the visit reCAPTCHA link.
Once on the site, click on Get reCAPTCHA to continue.
You will be asked to sign in with your Google account. After logging in, you will be redirected to a page where you can register your site for reCAPTCHA.
Enter the name of your website in the label field. This is for your own use, so that you can identify the website if you ever needed to get the keys again.
After that you need to add your website’s domain, such as example.com.
To save your site, click on the Register button.
You will now see a page with site key and secret key for your website.
Copy your site and secret key, and switch back to WPForms » Settings page. Paste your site and secret keys under the reCAPTCHA settings.
Don’t forget to click on the Save General Settings button to store your changes.
Adding reCAPTCHA to Your Form
Let’s create a new form. You can do this by going to WPForms » Add New.
On the next screen, you need to enter your form name.
Next, select the Simple Contact Form template. The basic contact form fields will be selected with this template.
It is easy to customize your contact form. Simply drag & drop the fields you want from the left column into the right preview window.
Finally, to enable reCAPTCHA in your contact form, go to Settings » General. At the bottom, click to enable reCAPTCHA.
Once it’s enabled, don’t forget to save your form.
Adding a Contact Form with CAPTCHA
WPForms allow you to add your forms in various locations including your blog posts, pages, and your sidebar (widget-ready areas).
The most common way to add the form is with the post / page embed option. Start by creating a new post or page in WordPress and then click on the Add Form button there.
Next, you need to select your contact form in the modal popup and click Add Form.
After that simply publish your page and view it.
Here’s a preview of what our WordPress contact form with reCAPTCHA look like:
You are all set to prevent spam on your forms. We hope this article has helped you learn how to add reCAPTCHA in contact forms on your WordPress site.
Looking for more ways to keep your site safe? Here are a few other methods for building a spam-free contact form without CAPTCHA. You can also check out these 10 tips to prevent spam user registration.