How To Remove Google reCAPTCHA Logo from Contact Form 7 in WordPress (Hide reCAPTCHA badge)

How To Remove Google reCAPTCHA Logo from Contact Form 7 in WordPress (Hide reCAPTCHA badge)
Last updated on

We will guide you remove Google reCAPTCHA logo in WordPress. You can hide reCAPTCHA badge when you’re using Contact Form 7 or not.

1. CAPTCHA & Google reCAPTCHA v3

As you know, most of the website, blog are used CAPTCHA to prevent automated access by robots, bots, spam …

Most of people ever encountered CAPTCHA requires confirmation. We were created to verify the access right is human and not a bot. Login page are examples for using CAPTCHA. We never want to bot account registration, so they use CAPTCHA to prevent bots to do it.

Recently, Google launched of reCAPTCHA version 3 (v3). It gives webmasters more options when needed handle unwanted website traffic (bad traffic).

In this version, it completely changed compared to the previous version. Instead of immediately visible to users, reCAPTCHA v3 calculates let webmasters know it is human or bots. The reCAPTCHA run the risk analysis in the background, alerting suspicious traffic, while users still comfortable on the page.

2. Remove reCAPTCHA v3 badge from Contact Form 7 plugin

If you are using the Contact Form 7 update and the latest version (at this time, it’s version 5.1.1), most websites will need to install, setup Google reCAPTCHA v3 to use (without any warning).

But one problem you encountered that’s Google reCAPTCHA logo will be displayed on every pages on the bottom right of the screen that pops out when hovering. This is according to our assessment is creating a bad experience for users.

Furthermore, the display of Google reCAPTCHA (“protected by reCAPTCHA” badge) in all pages, your website, blog will slow down a bit (reflect by PageSpeed Score). ReCAPTCHA badge when displayed by our website will have to load additional 1 JavaScript library from Google to display this badge. You can see the screenshot below for more details (checked with GTmetrix):

Google reCAPTCHA v3 affect PageSpeed GTmetrix - Defer parsing JS

and

Google reCAPTCHA affect speed GTmetrix YSlow

Therefore, in this article we will help you hide Google reCAPTCHA v3 from CF7 (only show it when necessary).

– First, you open the functions.php file of your theme (using File Manager or FTP Client). This file is locate in: /wp-content/themes/your-theme/ and add the following  snippet (we’re using this code to remove reCAPTCHA box on every page):

remove_action( 'wp_enqueue_scripts', 'wpcf7_recaptcha_enqueue_scripts' );

– Next, you will add this snippet in the page you want it to display Google reCAPTCHA (contact page, login, register page …):

if ( function_exists( 'wpcf7_enqueue_scripts' ) ) {
	add_action( 'wp_enqueue_scripts', 'wpcf7_recaptcha_enqueue_scripts', 10, 0 );
}

With this ways that’s best for page’s speed performance.

Bonus Tip: if you have done two steps above but Google reCAPTCHA logo is still showing on every page then you can try with this way (you can easily do it even when you’re a beginner in WordPress). You will need put this snippet in functions.php file only (replace other_pages with the page (post_name or slug) you want to show Google reCAPTCHA badge):

function oiw_load_recaptcha_badge_page(){
	if ( !is_page( array( 'contact','other_pages' ) ) ) {	
		wp_dequeue_script('google-recaptcha');
	}
}
add_action( 'wp_enqueue_scripts', 'oiw_load_recaptcha_badge_page' );

As our blog, we’re using only Google reCAPTCHA badge on contact page.

Notice: If you already removed the badge on all pages then you will need to comply with the terms of use of Google. To to this, you need to be including the following text on each of your contact forms or your page which you want to hide Google reCAPTCHA v3 badge (add this just before the submit button of this form, page):

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.

We recommend you run Google reCAPTCHA script on more pages that would be more accurate when determining whether visitors (human) or bots.

3. Hide reCAPTCHA v3 badge in WordPress even you’re not using CF7

– If you do not use Contact Form 7 but you still using Google reCAPTCHA, you can find and install Advanced noCaptcha & invisible Captcha plugin to help you hide Google reCAPTCHA badge.

Advanced noCaptcha & invisible Captcha plugin
– Either you do not want to use the plugin and just want to hide reCAPTCHA logo by using CSS code then you can use this CSS code to do that (hide invisible reCAPTCHA badge):

.grecaptcha-badge {
opacity:0!important;
}

or

.grecaptcha-badge { 
visibility: hidden;
}

If you only want to re-style of Google reCAPTCHA then you can edit CSS to change position, background, resize Google reCAPTCHA.

All done. That’s all you need to do to remove Google reCAPTCHA v3 badge in WordPress.

NOTE: If you have just updated Contact Form to the latest version (> 5.2.x) then you can try with this post: Disable Google reCAPTCHA for all pages Except specific page like Contact Page or Submit Form with Contact Form 7




Post a Comment

Please keep in mind that all comments are read and moderation.
Your email address WILL NOT be published. Please DO NOT use keywords in the Real Name field. Thank you !




    49 Comments

  1. I used your code snippet to hide the recaptcha from other pages and make it appear on the contact form page. For some reason it stopped working and the recaptcha appears everywhere. What is the reason that this is happening? Is there any work around? Thank you.

    Reply

      • Thank you for your answer. I had to slightly modify the snippet so that it could actually work adding the following extra “dequeue”:

        		 wp_dequeue_script('google-recaptcha');
        

        So the whole snippet looks like this for me to work:

        function oiw_disable_recaptcha_badge_page(){
          if ( !is_page( array( 'contact' ) ) ) {
          
        		 wp_dequeue_script('google-recaptcha');
        		wp_dequeue_script('wpcf7-recaptcha');
            wp_dequeue_style('wpcf7-recaptcha');
        }
        }
        add_action( 'wp_enqueue_scripts', 'oiw_disable_recaptcha_badge_page' );
        

        This comment might best belong to snippet for the last version, if anyone else faces the same problem. Thanks again!

        Reply

        • Yes. Exactly. This is additional code from our old post and we were missing a line of code when copying it from functions file 🙂

          Reply

  2. How do I remove it altogether? I uninstalled CF7, cleared my cache and cloudflare, but it still is present. I even deleted my key/website on the recaptcah website. But it’s still there. I checked every single plugin and i didn’t see any using it.

    Reply

    • Ariel,

      Would you want to delete Google reCAPTCHA for all page? Please drop your URL of your website here for checking help you.

      Reply

      • thanks, appreciate it. it’s ariel-lim.com
         
        Yes, i want to delete it because i didn’t want to add it there in the first place. The only reason it was added in the first place was CF7. But, i don’t need it anymore. Deactivated and deleted it. But the reCaptcha is still on all my pages.

        Reply

        • Ariel,

          We have just checked it. You’re using Auto Optimize plugin. We think you need to clear all cache of the plugin and cache, cookies of your browser also. Or you can deactivate Auto Optimize plugin for checking Google reCAPTCHA problem.

          Keep us update.

          Reply

          • Thanks for checking, but i already cleared my cache several times. I also purged the cache in cloudflare. and it’s still there.

          • Ariel,
             
            You can send the credentials of your website via our Contact Page. We will take a look and remove it help you for FREE. It’s simple we think.

          • Thanks for the offer. Can you tell me where to look instead? and what to look for? I can dig in myself.

  3. Thanks so much for this post.

    This worked beautifully: remove_action( ‘wp_enqueue_scripts’, ‘wpcf7_recaptcha_enqueue_scripts’ );

    However, as expected, when I put this code in functions.php, it broke my contact form here: https://injuredathletestoolbox.com/contact/

    I cannot figure out the second part of your instructions.
    Next, you will add this snippet in the page you want it to display Google reCAPTCHA (contact page, login, register page …):

    1
    2
    3
    if ( function_exists( ‘wpcf7_enqueue_scripts’ ) ) {
    add_action( ‘wp_enqueue_scripts’, ‘wpcf7_recaptcha_enqueue_scripts’, 10, 0 );
    }

    Stupid question amnesty…I would like to add this back to my contact page so my contact form works again, but I do not know *exactly* where in WP to add this to my contact page. If I add this code to pages–>contact, the code shows. If I add this code to my contact form 7 form, the code shows.

    I’m obviously doing something wrong, and I don’t know what.

    Thanks for your help.

    Heidi

    Reply

    • Heidi A,
       
      You need to find the file (.php) of your contact page and add this snippet into it:
       
      if ( function_exists( 'wpcf7_enqueue_scripts' ) ) {
          add_action( 'wp_enqueue_scripts', 'wpcf7_recaptcha_enqueue_scripts', 10, 0 );
      }
       
      If you can not find out where is it then you can try with Bonus Tip (following these steps in our article) by adding this snippet into functions.php file:
       
      function oiw_load_recaptcha_badge_page(){
          if ( !is_page( array( 'contact','other_pages' ) ) ) {  
              wp_dequeue_script('google-recaptcha');
          }
      }
      add_action( 'wp_enqueue_scripts', 'oiw_load_recaptcha_badge_page' );
       

      Reply

      • Thank you so much for getting back to me. I found the contact php page and added the snippet, and my contact form still will not work. What can you recommend? I’m attaching three screenshots to hopefully help.
         
        Notice I added if ( function_exists( ‘wpcf7_enqueue_scripts’ ) ) {
        add_action( ‘wp_enqueue_scripts’, ‘wpcf7_recaptcha_enqueue_scripts’, 10, 0 );
        }
         
        to my child theme and it made the recaptcha loading on every page go away.
         
        I’m adding if ( function_exists( 'wpcf7_enqueue_scripts' ) ) {
            add_action( 'wp_enqueue_scripts', 'wpcf7_recaptcha_enqueue_scripts', 10, 0 );
        }
         
        in my theme (not child), and my contact form still does not work.
         
        Thanks for your help,
        Heidi

        Reply

  4. in:
    “replace other_pages with the page (post_name or slug) you want to hide Google reCAPTCHA badge”
    “you want to hide” must be replaced with “you want to show”

    Reply

  5. Hi, I don’t have any knowledge of CSS so Im just following your instructions.
    I have access to FTP and added the snippet to the functions page. However it doesnt remove the Captach and in fact it shows the line of code on the top of the page.
    I tried to apply the code on the bottom of the page and on the top later. What am I doing wrong?

    Reply

    • Wiebe,

      When you added the snippet to the functions file (not page) and it’s showing the line of code on the top of the page so you did wrong. Because it’s PHP code, you should put it in functions.php file before ?> tags.

      Reply

  6. Hi there,

    The first part of your code works well for hiding the ReCaptcha on all pages, but I don’t get the second part to work. For this I created a wordpress page template for my contact pages and added your snippet:

    I tried various locations in the template file, but it never made the ReCaptcha show on the specific page: https://www.fairyloot.com/contact/

    Any ideas why?

    Thanks in advance! 🙂

    Reply

    • Hi Hubsi,

      Did you try with Bonus Tip?

      Putting this snippet in functions.php:

      function oiw_load_recaptcha_badge_page(){
      if ( !is_page( array( 'contact','other_pages' ) ) ) {
      wp_dequeue_script('google-recaptcha');
      }
      }
      add_action( 'wp_enqueue_scripts', 'oiw_load_recaptcha_badge_page' );

      Reply

      • Amazing thanks!

        I put:

        function oiw_load_recaptcha_badge_page(){
        if ( !is_page( array( ‘contact’,’home ) ) ) {
        wp_dequeue_script(‘google-recaptcha’);
        }
        }
        add_action( ‘wp_enqueue_scripts’, ‘oiw_load_recaptcha_badge_page’ );

        and it now only shows on contact but no other page. I didn’t need to include any other page slugs for them to not show the ReCaptcha.

        Reply

          • Hubsi,

            You can do that by editing this line:

            if ( !is_page( array( 'contact','other_pages' ) ) ) {

            Replace other_pages with which pages you want to show the reCAPTCHA.

            For example: if ( !is_page( array( 'contact','our-story' ) ) ) {

  7. This works great! Thanks for the post. Currently I am trying to hide the Google badge from the contactpage but ALSO from all its chil-pages like ‘contact/subpage1, contact/subpage2, etc.
    Do you have any suggestion on how to do that?

    Reply

    • Marcel,

      You can try this:

      function oiw_load_recaptcha_badge_page(){
      if ( !is_page( array( 'contact/subpage1','contact/subpage2' ) ) ) {
      wp_dequeue_script('google-recaptcha');
      }
      }
      add_action( 'wp_enqueue_scripts', 'oiw_load_recaptcha_badge_page' );

      Reply

  8. Hi, I want to keep my recaptha running on my word-press website and hide only slide alert showing bottom right on website.

    I am using V3recaptcha in my website with cf7
    kindly provide me solution asap.
    Thanks

    Reply

    • Nisha,

      If you want to keep reCAPTCHA V3 running on your WP website and hide it only then you can try with some CSS tips as we mentioned in the article (hide reCAPTCHA badge):

      .grecaptcha-badge {
      display: none;
      }

      Reply

  9. Hello in the part where it says ‘Next, you will add this snippet in the page you want it to display…(contact page,…), where exactly is this page? Is it the page.php? I’ve done in the remove_action part.

    Reply

    • Joey,

      No, it’s not page.php. For example: you have/create a contact page template with name contact.php and you will put that snippet there.

      Or you can try with Bonus Tip in our article.

      Reply

    • Mike,

      You can find your contact page file and put that code into it (if you don’t have it then create a new). It would be easier for you when using our Bonus Tip.

      Reply

  10. I used the Bonus Tip code and it works like a charm.

    Just put the name of the page shown in the URL with a comma to separate each web page.

    For example, mine was like this
    functions.php file

    function oiw_load_recaptcha_badge_page(){
    if ( !is_page( array( ‘news’, ‘products’, ‘ forms’ ) ) ) {
    wp_dequeue_script(‘google-recaptcha’);
    }
    }
    add_action( ‘wp_enqueue_scripts’, ‘oiw_load_recaptcha_badge_page’ );

    Thanks.

    Reply

  11. Thanks for this Post, as fine as reCaptcha3 will possibly be, the symbol on each page is horrifying.

    The second Part of Code beginning after “– Next, you will add this snippet in the page you want it to display Google reCAPTCHA (contact page, login, register page …):” doesn’t work on my site.

    Where do I have to put it in,and how?

    Reply

Get $100 Free from Vultr to accelerate your website and application Register a Domain Name on Namesilo


Categories