Integrating Google reCAPTCHA V3 with Wordpress WPForms
Tags: webdev, wordpress, security, google
Published: 2023-12-21 12:45:11

[WordPress](https://wordpress.org/) 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](https://woo.com/) through [Woocommerce](https://wordpress.org/plugins/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](https://wpforms.com/). In my case I wanted to integrate a "Contact us" form specifically to my Wordpress site, and [WPForms contact us form plugin](https://wordpress.org/plugins/wpforms-lite/)

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](https://shoppersprestige.com/) who is one of my clients.

First you need to go visit [Google reCAPTCHA console](https://www.google.com/recaptcha/about/). And you'll be on a page similar to this.


![Google reCAPTCHA console](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ypq73zrw2ci2k8rufy96.png)

Click on "v3 Admin Console" link.

Then you'll be on a page like this.


![v3 Admin Console](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bqbaymugs3ndz2cxa06t.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/26xigk3b0pzprgtqkrm1.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tnfr4pji1gh071kovnan.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lbpqs4l68779iaki67dw.png)

If you like to check the visual guide of this, please [watch this video](https://www.youtube.com/watch?v=S0-WWkRfsL8).