Support » Plugin: Contact Form 7 » reCaptcha badge on ALL pages, not just pages with Contact Forms!

  • I applied the one-line code fix to Contact Form 7 to make reCaptcha v3 work. I’ve got a single page on my site that uses Contact Form 7, but now I have the “protected by reCAPTCHA” badge on every single page and post on my site.

    That brings up two questions:

    1 – Can I have the badge only appear where it’s used?

    2 – Can I get Contact Form 7 to only touch pages/posts it’s used on? Integrating it everywhere, even where it’s not used at all, adds a bunch of unnecessary server-client interactions that only serve to extend page load times and slow my site down.

Viewing 15 replies - 1 through 15 (of 31 total)
  • zapgadget

    (@zapgadget)

    That was my first thought too. This is way too intrusive, and appears as if its setting the terms and privacy policy for my site.

    mfgstories

    (@mfgstories)

    No way I want the reCAPTCHA badge on every page. I have also noticed that I am now getting many more spam marketing inquires now that the [I’m not a robot] block is gone. I’ve had to temporarily disable CF7 which BTW does remove the reCAPTCHA badge from all pages.

    This is a downgrade and I’m already looking for a replacement plugin. Any ideas?

    • This reply was modified 3 months ago by  mfgstories.
    • This reply was modified 3 months ago by  mfgstories.
    linux4me2

    (@linux4me2)

    The “hack” is necessary in my opinion. My sites have no javascript errors that would disable the reCAPTCHA code, and I’d rather have a rare user here and there running with javascript disabled not be able to use the contact form than have the 10-20 spam emails I was getting per site per day before the hack. You can read the developer’s reasoning about the hack here.

    You can easily hide the v3 reCAPTCHA badge on all but your contact page and still be in compliance with Google’s terms. Just find the page ID of your contact page and replace the “XX” in the CSS below with your contact form page ID:

    
    body:not(.page-id-XX) .grecaptcha-badge {
    	display: none;
    }
    

    More information is available here.

    Ideally, even if you hide the badge, you’ll run the reCAPTCHA code on every page to increase the accuracy of the bot versus human scoring.

    Thanks, linux4me2. That’s a good kludge workaround, and a kludge is a good first step, but I’m still hoping for something that will keep both Conact Form 7 and reCAPTCHA from impacting every single page on my site. Hiding the element addresses the visual aspect, but not the server hits or page speed.

    I agree that the hack to recaptcha.php is completely necessary. I have a pretty low-traffic site on a semi-shared (VPS) host, but even so, I started getting inundated with spam as soon as Contact Form 7 updated. The hack seems to have addressed the problem.

    linux4me2

    (@linux4me2)

    @eharris, I’m on a different server of course, but I haven’t seen any difference in GTmetrix page load speeds between Google reCAPTCHA v2 and v3. I believe v2 loaded on every page unless you used the CF 7 instructions to load only on contact form pages. V3 just makes it more obvious because of the badge showing up on every page.

    What kind of server hits and page speed issues are you seeing?

    linux4me2

    (@linux4me2)

    @eharris, you got me wondering, so I tested the speed, and I think you’re right about v3 being slower and more resource-hungry.

    I’ve got GTMetrix set to warn me when any of my sites’ home pages take longer than 5 seconds to load, and I’ve gotten more warning emails in the last few days. Whether that’s related to this update or not, I can’t say for sure. I haven’t been closely tracking and trending site speed.

    This may have been an issue with the prior version of Contact Form 7, too, and I just didn’t notice. I have in the past noticed that some WordPress plugins load even on pages they’re not used in. Is this an inherent limitation in WordPress’ plugin system, or is it just that plugin authors go for the easiest solution, even if it means running unnecessarily?

    dukeo

    (@dukeo)

    To be clear, by using Recaptcha v3, your current Privacy Policy becomes invalid because Google is now tracking your visitors, and analyzing their behavior, on every single page of your website.

    If you’re based in Europe, you’re basically breaking the law since this is not GDPR-compliant and doesn’t ask for any consent for the constant tracking.

    The “workaround” with CSS only hides the badge so visitors can’t see it, but they’re still being tracked on every single page.

    PS: As an extra bonus regarding page speed, it loads some extra resources on every single page of your website.

    earrame

    (@earrame)

    I just found this at https://developers.google.com/recaptcha/docs/faq

    ***I’d like to hide the reCAPTCHA v3 badge. What is allowed?

    You are allowed to hide the badge as long as you include the reCAPTCHA branding visibly in the user flow. Please include the following text:

    `This site is protected by reCAPTCHA and the Google
    <a href=”https://policies.google.com/privacy”>Privacy Policy</a> and
    <a href=”https://policies.google.com/terms”>Terms of Service</a> apply.`

    • This reply was modified 3 months ago by  earrame.

    @erik,

    You can do it (show the reCAPTCHA badge appear where it’s used only) by following these steps in this article: https://ohiwill.com/how-to-remove-google-recaptcha-logo-from-contact-form-7-in-wordpress-hide-recaptcha-badge/

    I hope this will help you remove Google reCAPTCHA badge when using Contact Form 7

    Hi @takayukister

    Is there coming an update about this issue? It is very intrusive as other users pointed out.

    Hi!
    I suppose using something like this in functions.php

    function conditionally_load_plugin_js_css(){
    	if(!is_page(array(40,534)) ) { # Only load CSS and JS on needed Pages	
    		wp_dequeue_script('contact-form-7'); # Restrict scripts.
    		wp_dequeue_script('google-recaptcha');
    		wp_dequeue_style('contact-form-7'); # Restrict css.
    	}
    add_action( 'wp_enqueue_scripts', 'conditionally_load_plugin_js_css' ); 

    Sorry,
    missed to put enclosing curly bracket for function, just before add_action.
    40,534 – needed to be changed to actual page ID’s

    Currently I have rolled back my site to v5.0.5, and I have several other sites that are still on this version.

    1. Volume of spam getting through increased significantly
    2. Every single page on my site – not just the contact form – now has an obtrusive Google privacy policy ad over the top of my content that is especially annoying on mobile devices.

    Is there any plan to offer users other alternatives, or at least restrict the Google ad to just the contact form?

    If not – my choices are either to remain on v5.0.5 or look for an alternative

    Brian

    Brian – The thread above will help you with #2. You can hide it on other pages with some simple CSS. I haven’t had a chance to try Ionty’s JavaScript, though I intend to, because this plugin is slowing my sites WAY down. Pages that used to take 3-5 seconds to load in GTMetrix (already pretty slow) now consistently take 5-8 seconds to load. Hiding the Google banner won’t change that, but keeping the plugin from loading where it’s not needed should!

Viewing 15 replies - 1 through 15 (of 31 total)
  • You must be logged in to reply to this topic.