DEV Community

Cover image for Integrating Google reCAPTCHA V3 with Wordpress WPForms
Buddhi Eashwarage
Buddhi Eashwarage

Posted on

Integrating Google reCAPTCHA V3 with Wordpress WPForms

WordPress is one of the most popular CMS(Content Management System). Not only that but also it's a highly customizable platform. As an example if you want to get e-commerce features get it added top of your normal CMS features, you can integrate Woocommerce through Woocommerce plugin.

Hope you got an idea how far Wordpress is a customizable platform. Wordpress plugins do the magic!! So we can simply integrate a drag and drop Wordpress form builder called WPForms. In my case I wanted to integrate a "Contact us" form specifically to my Wordpress site, and WPForms contact us form plugin

Everything went well for several weeks. After that there was a sudden spike in "Contact us" form submissions, and realized that it's not normal. Some spammers and bots simulated actual user behaviors. So I wanted to get rid of it, and decided to go ahead with Google reCAPTCHA integration with the "Contact us" form. I wanted to integrate reCAPTCHA V3 specifically with the form since it gives a better user experience because V3 is based on a scoring unlike ticking a checkbox in V2.

I'll demonstrate how to integrate this to your Wordpress site, and I'm using a site called Shoppers' Prestige who is one of my clients.

First you need to go visit Google reCAPTCHA console. And you'll be on a page similar to this.

Google reCAPTCHA console

Click on "v3 Admin Console" link.

Then you'll be on a page like this.

v3 Admin Console

Simply fill the details such as "Label" to give a meaningful name, and the domain that you're going to use Google reCAPTCHA. The most important thing is to choose reCAPTCHA type as the V3. Once everything completed, submit the form, and finally it'll reveal the "Site Key
" and "Secret Key". You need only these 2 to integrate reCAPTCHA with WPForms.

Let's jump into WPForms plugin setting section. Navigate to WPForms settings section in Wordpress, and then fill the details as below.

WPForms plugin settings

Replace "Site Key" and "Secret Key" with your credentials.

Finally you just need to enable the captcha on desired forms. You can simply do this by visiting to "All Forms" section in the plugin, and simply selecting the relevant form.

If everything went well, you should be able to see the Google reCAPTCHA on your "Contact us" page or any other desired page as below.

Contact us Google reCAPTCHA

And you can see the analytics of the Google reCAPTCHA, you can check that on the Google reCAPTCHA console dashboard too.

Google reCAPTCHA console dashboard

If you like to check the visual guide of this, please watch this video.

Top comments (0)