Contact Form 7 Google Captcha V3 Spam

by | Dec 14, 2018 | 0 comments

Contact Form 7 Google Captcha V3 Spam

by | Dec 14, 2018 | Dieno Digital, Digital Strategy Blog, Wordpress | 0 comments

This one is for the developers and geeks out there reading our my blog!

It’s been a really busy couple weeks for anyone who manages multiple wordpress sites or who build’s wordpress websites. Notifications of PHP versions reaching their end of life, WordPress 5.0, and major plugin updates have been keeping everyone busy!

That being said, many of us use Contact Form 7, a plugin that has had it’s ups and downs, has some irony to using it, but overall performs quite well. There was a recent release of a new version of Contact Form 7 that fored you to move from any previous versions of Google’s Recaptcha service to version 3. With that came a headache.

WordPress websites that were updated and running Contact Form 7 suddenly saw an increase in spam. The [recaptcha] shortcode in the form was no longer doing anything (or invisible) and some mailboxes were getting hammered by spam bots and companies trying to sell their services.

The first thing to note is that you will need to go into Google’s Recaptcha and make sure you’ve set the site up with Version 3 (v3). If you are running a previous version of recaptcha, I suggest you delete the site and recreate it, then generating new secret and site ID’s.

The next time is then re-entering those keys into the Contact Form 7 plugin’s “integration” modules section.

Here’s the tricky part, and hopefully one of the Contact Form 7’s developers will update their code and release a new version soon; you will need to manually update the plugin’s PHP file to actually prevent spam from coming in. Shout out to PeterUpfold for posting the solution on the WordPress Support Forum.

He wrote:

It looks like there is a logic issue where failing to provide the g-recaptcha-response allows the submission through.

This is a _very_ unofficial change on my part, but it seems to work for me.
Edit line 114 of modules/recaptcha.php (version 5.1)
It reads:
return $spam;
Change it to:
return true;
This will change it so that any submission that does not attempt the Recaptcha V3 validation will be rejected.

So far my testing has proven that this is a trusted fix and it will correct the issue.

Depending on how your wordpress instance has been implemented, this could be a quick fix or something that requires you FTPing into your server and manually updating the file.

If you don’t have FTP access, but have full Administrator access to your wordpress site – check out the plugin “WP File Manager” which allows you to browse the files on your host and edit them on the fly.

NOTE: BE CAREFUL IF YOU ARE UPDATING THE CODE ON YOUR SITE MANUALLY, and of course we\I are not liable if you break something 🙂

 

UPDATE: The above process only reduced the spam by roughly 50% on a few sites we manage, so we quickly shifted to WPForms.

 

0 Comments

Submit a Comment

What Our Clients Are Saying

Travco RV

Leland lets me focus on running my business while he takes care of the digital marketing for us. He really...

Rod, Travco-Rv.com

Dieno Digital Marketing Services
5
2018-04-27T20:16:51+00:00

Rod, Travco-Rv.com

Leland lets me focus on running my business while he takes care of the digital marketing for us. He really takes care of our companies marketing with his expertise and has a lot of great ideas. We are very fortunate to  have him helping us with fresh new ideas.

British Columbia Coalition Of Motorcyclists

We've been working with Dieno Digital, for the past year and a half now and couldn't be happier with all...

Tara, British Columbia Coalition Of Motorcyclists

Dieno Digital Marketing Services
5
2018-04-27T22:05:28+00:00

Tara, British Columbia Coalition Of Motorcyclists

We've been working with Dieno Digital, for the past year and a half now and couldn't be happier with all the updates  to our website. Leland is always very responsive and able to answer all of questions or fix any issues in no time at all. We look forward to continuing to expanding and broadening our website with Dieno Digital.

Amplifylife.ca

Been working with Leland on a project for a Not-For-Profit organization and it is a pleasure to be able to...

Rob - Amplylife.ca

Dieno Digital Marketing Services
5
2018-05-03T19:49:40+00:00

Rob - Amplylife.ca

Been working with Leland on a project for a Not-For-Profit organization and it is a pleasure to be able to bring a high level of creativity, energy, expertise and professionalism to the project for their digital marketing needs. We are so excited for the chance to work more with Leland and Dieno Digital.

FS Designs

Leland is extremely knowledgeable and super pleasant to deal with. He helped me get my website running for my graphic...

F.S.

Dieno Digital Marketing Services
5
2018-06-19T18:50:18+00:00

F.S.

Leland is extremely knowledgeable and super pleasant to deal with. He helped me get my website running for my graphic design business and improved my SEO so that I appear more frequently and near the top of searches. He a great digital and web strategist and I would highly recommend his services.
5
4
Dieno Digital Marketing Services
[newsletter_form]
<div class="tnp tnp-subscription"> <form method="post" action="https://www.dienodigital.com/?na=s"> <input type="hidden" name="nlang" value=""><div class="tnp-field tnp-field-firstname"><label for="tnp-name">First name or full name</label> <input class="tnp-name" type="text" name="nn" value=""></div> <div class="tnp-field tnp-field-email"><label for="tnp-email">Email</label> <input class="tnp-email" type="email" name="ne" value="" required></div> <div class="tnp-field tnp-field-button"><input class="tnp-submit" type="submit" value="Subscribe" > </div> </form> </div>