Jehoyakim Jena

Jehoyakim Jena

Share

Share on facebook
Share on twitter
Share on linkedin
Share on email

Do you have a WordPress form on your website or blog?

Did you notice that there are so many spam comments and submissions that end up coming into your site but you don’t know how to control them from happening?

In this blog post, I’ll help you understand how to build a Spam-Free WordPress Contact Form so that you can finally get rid of those spam comments that keep coming in.

First of all, I want you to understand that you’ll need to be using WPForms to make this thing work out.

WPForms is the easiest beginner-friendly contact form builder. Click here to install it.

There are many ways to filter spam submissions from coming in through your contact forms.

But let’s go over 3 ways you can do that:

  • Add reCAPTCHA to Your Contact Forms.

  • Use the WPForms Custom Captcha Addon.

  • Build a SPAM-Free Contact Form Without CAPTCHA.

How To Add reCAPTCHA To Your Contact Forms.

You may already know that a reCAPTCHA is this thing that asks you to verify if you’re human or not. This is done so that we can prevent spammers and bots from getting into the contact forms.

Here’s one if you’ve never seen one.

recaptcha

This reCAPTCHA section is for site visitors to click on to prove they’re human when they submit a form.

Here’s why reCAPTCHA helps:

  1. Block spam – By verifying that a human is actually submitting a form, all automated spam attempts are blocked. Meaning that they won’t be able to go through unless they verify themselves that they are not robots. This level of added security can also make people feel that the form is secure.
  2. Easy to use – Initially google created CAPTCHA to do two things at the same time: help machines (computers) translate anything that was non-digital and fight spam. They were all jumbled text but, the jumbled text was difficult for people to read and answer correctly. Once Google found that out, they improved their CAPTCHA tool, and the new reCAPTCHA v2 was much easier for people. Now instead of entering weird text, people could just put their mouse over the checkbox and click the tool and it understands that this is not an automated spam bot. This became much easier to prove that they are not robots.

Now, here’s how to add a reCAPTCHA checkbox to your contact forms.

Step 1: Create a Simple Contact Form in WordPress.

The first thing you’ll need to do is install and activate the WPForms pluginClick here to learn how to install a plugin in WordPress.

Next, you’ll need to create a Simple Contact Form. You can do that right inside WPForms.

Simple Contact Form

Step 2: Configure the reCAPTCHA Settings.

Before you do anything, you need to configure the reCAPTCHA settings in WordPress.

To do that, go to WPForms -> Settings. Then, click on the reCAPTCHA tab. Please refer to the screenshot below.

wpforms-recaptcha-settings-tab

Choose reCAPTCHA v2 to add the reCAPTCHA box to your contact form. Check the right radio button as in the image.

select-checkbox-recaptcha-setup

Essentially, reCAPTCHA is a service provided by Google. It’s free but it requires a site key and secret key. It is easy to generate those keys if you visit Google’s reCAPTCHA setup page.

Once you’re on their setup page, you have to click on the Admin console button in the top right corner.

Click-admin-console-button-on-Google-reCAPTCHA-page

Then, it will ask you to sign in to your Google account.

After you’ve logged in, you’ll be redirected to a page where you can register your website for a reCAPTCHA.

If you’ve already registered your website for Google reCAPTCHA in the past, you’ll see a different screen. In that case, click on the plus sign to Register a new site. It allows you to register multiple sites as seen in the image below.

recaptcha-admin-console-add-new

Quickly enter the name of the website in the label field. This is for your own use so that you can identify the website later if you ever needed to get the keys for your site again.

register-new-site-for-recaptcha

Then, you’ll have to choose the type of reCAPTCHA you want to add to your website. In this example, we’ll select reCAPTCHA v2 and then select the “I’m not a robot” checkbox radio button. This will help us validate all the requests that are coming are not robots.

how-to-setup-recaptcha-on-wordpress-forms

After that, you will need to add your website’s domain. You can also enter your email address to verify your ownership. Select the checkboxes and also notify yourself that you’d like to get alerts on form submissions.

Finally, click the Submit button. This will save all the data coming through this form.

enter-domain-in-recaptcha-setup-1

On the next page you’ll see that the page gives a site key and secret key for your website.

recaptcha-keys

You will need to Copy your site key and secret key and switch back to the WPForms -> Settings page.

Now you can paste your site key and secret key on that reCAPTCHA settings page. Check the no-conflict mode as well and then.

Click on the Save Settings button to store all these changes. It is important you don’t miss this otherwise your reCAPTCHA won’t work.

recaptcha-setup-checkbox

Step 3: Add reCAPTCHA to Your Contact Form.

Adding reCAPTCHA to your WordPress form is an easy process.

You would have already created the contact form.

Now, to enable reCAPTCHA in this simple contact form, go to Settings -> General in the form editor.

At the bottom, you will have to check the box next to Enable Google Checkbox v2 reCAPTCHA.

enable-recaptcha-on-wpforms

Once this is done, click Save. It’s on the top right corner in case you didn’t know.

Now you can add your contact form which has the Google reCAPTCHA on your website.

Step 4: Add Contact Form with reCAPTCHA to WordPress.

WPForms allows you to add your forms to many locations on your website, including your blog posts, pages, and even sidebar widgets. This is what I love about WPForms. It’s such a friendly tool.

Let’s dive in and take a look at the most common post/page embed option.

Here’s what you’ve got to do. Create a new post or a page in WordPress and then click on the Add WPForms icon inside of a block.

insert-wpforms-into-page-or-post

Now, select that form from the dropdown.

insert-contact-form-into-block

Then hit on publish, your post or page will have the form appearing on your website. Take a look at what we’ve achieved below.

recaptcha-in-form

How To Use The WPForms Custom CAPTCHA Addon.

If you don’t want to use the Google reCAPTCHA option, but you want to add an interactive reCAPTCHA element to your website, you can use the Custom Captcha Addon that comes with WPForms.

This addon is so good. With this addon, you can actually define custom questions or use some random math questions as the CAPTCHA to fight spam form submissions. Isn’t that cool?

So let’s try this method out. Here’s how we do it:

Step 1: Create a Simple Contact Form in WordPress.

The first thing you’ll need to do is install and activate the WPForms plugin. Look at how to install a plugin in WordPress.

Then, go to WPForms -> Addons and find the Custom Captcha Addon.

Install and activate the Custom Captcha Addon. Take a look at the picture below.

Custom-Captcha-Addon

Next, you’ll need to create a WordPress contact form. It’s pretty straight forward as we’ve already created one in the last part.

Simple-Contact-Form

Step 2: Add and Customize the Captcha Form Field.

Once the form is created, stay in the form builder to add that custom captcha form field. It will be somewhere down.

WPForms-Captcha-Form-Field.

Once you’ve found it, just drag it from the left panel to the right panel and then add it to your form. The form field will automatically display a random math question for site visitors to answer before they can submit their form on your website.

A new addition, subtraction, or multiplication problem will appear every time the page loads or refreshes. This helps to keep things fresh and not repeat.

For help on how to customize the Math Captcha, check out the documentation WPForms offers on how to change the Math Captcha.

Custom-Captcha-Math-Example

Anytime you want to make changes to the form field, just click on it and you do just that.

Now you can change the name on the label, type of captcha you want, and add a description if you’d like. Take a look at the picture below for reference.

Math-Captcha-Changes

If you prefer to use a custom question and answer instead of the Math Captcha, you will have to change the type of captcha to Question and Answer in the Field Options section. Refer to the image below. Just select the drop-down option and change that.

Question-and-Answer-Captcha

Changes will reflect accordingly. Here’s what you can do – you can change the question and answer so that site visitors always have to answer them if they want to submit the form on your website. This prevents spammers and bots.

If you want to display random questions and answers every time your page loads or refreshes, click on the plus (+) button to add another question and answer. It’s up to you to decide what kind of questions you’d like to ask. Just make sure it’s simple for people to go through to submit the forms on your website.

Add-Question-and-Answer

Once you’re done, click Save after you’ve customized your own custom captcha.

Now, you’re ready to add that contact form to your website. Let’s go ahead and do it.

Step 3: Add Contact Form with Custom Captcha to WordPress.

WPForms allows you to add your forms to many locations on your website, including your blog posts, pages, and even sidebar widgets (if you didn’t know). This is a pretty standard feature that they’ve given us.

Let’s try to work with the most common post/page embed option.

Here’s what you need to do. Create a new post or page on your WordPress website and then click on the Add WPForms icon inside of a block.

insert-wpforms-into-page-or-post

Then, select the correct form from the dropdown options.

add-custom-captcha

Next, you can go ahead and add them to your site. It will publish your post or page with the contact form. Take a look at the image below to see the questions CAPTCHA.

Final-Custom-Captcha-Form

 

How To Build A Spam-Free Contact Form Without CAPTCHA.

Here’s where we are going to do something different. Normally we’d have to create a CAPTCHA where the reader has to figure out the CAPTCHA or do the math, which might be complicated for some people.

If we just create a simple contact form and just enable the invisible reCAPTCHA element you will have a spam-free WordPress contact form too.

Here’s how you can do it:

Step 1: Create a Simple Contact Form in WordPress.

The first thing you’ll need to do is install and activate the WPForms plugin.

Next, you’ll need to create a Simple Contact Form. You can create a simple contact form or even a multi-step contact form with WPForms on your WordPress website.

Simple Contact Form

Step 2: Configure the reCAPTCHA Settings.

You have to configure the reCAPTCHA settings.

Here’s how you do it, go to WPForms -> Settings. Then, click on the reCAPTCHA tab.

wpforms-recaptcha-settings-invisible

Choose Invisible reCAPTCHA v2 to add that Invisible reCAPTCHA to your contact form.

select-invisible-recaptcha

As I’ve mentioned earlier that reCAPTCHA is a service provided by Google. It is free but it requires a site key and a secret key. You can easily generate them for your website by visiting Google’s reCAPTCHA setup page.

On their site, you will have to click on the Admin console button in the top right corner to continue.

Click-admin-console-button-on-Google-reCAPTCHA-page

You’ll be asked to sign in with your Google account. After logging in, you’ll be redirected to a page where you can register your website for a reCAPTCHA.

If you’ve already registered a website for Google reCAPTCHA in the past, you’ll see a different screen. In that case, just click on the plus sign to Register a new site. (This step was already covered earlier).

recaptcha-admin-console-add-new

Now, you’ll need to enter the name of your website in the label field. This is for your own use so that you can easily identify the exact website if you ever need to get the keys again.

register-new-site-for-recaptcha

Then, choose the type of reCAPTCHA you want to add to your website. Here, we’ll select the Invisible reCAPTCHA badge. This validates requests in the background. Refer to the image below.

invisible-recaptcha-setup

After that, you will have to add your website’s domain name. Enter your owner email address, check the Terms of Service box and also the Send alerts to Owners.

Finally, click the Submit button. This will save all the info & conditions you’ve entered so far.

enter-domain-in-recaptcha-setup-1

Next on the next page, you’ll see the site key and the secret key for your website.

recaptcha-keys

Copy both the site key and secret key, and then switch back to the WPForms -> Settings page.

Make sure that the Invisible reCAPTCHA v2 is selected for Type. Paste your site key and secret key in the respective blank fields under the reCAPTCHA settings page on that screen.

Then, click on the Save Settings button to save all your changes.

recaptcha-setup-invisible

Step 3: Enable Invisible reCAPTCHA on Your Contact Form.

Enable the Invisible reCAPTCHA on your contact form. Go to Settings -> General in the form editor.

Then, scroll down and click the Enable Google Invisible reCAPTCHA checkbox. Only by doing this will the reCAPTCHA work on your website. Failing to do this might cause your reCAPTCHA not working as you expect. So make sure to check this box.

invisible-recaptcha-setup-wpforms

Finally, click Save. This option is available on the top right corner.

Now whenever someone tries to submit a form on your website, Google will automatically determine whether it’s a spambot trying to submit a fake form or not.

The best thing is that your readers will never see anything related to captcha and will simply submit their form without any issue.

If you like this method then you can implement this on your WordPress Website.

This is how you create a Spam-Free WordPress Contact Form on your WordPress Website. I hope you liked all the 3 methods we’ve discussed. Choose the one that sounds most appropriate to your needs.

If you have any further questions, please do let me know in the comments below. I’ll be sure to help you out.

So, if you’re looking to get WPForms to prevent Spam submissions, click here to get them.

You can also click the image below too.

WPForms Collect Payments