STOP Contact Form 7 reCAPTCHA v3 From Injecting Into Every Page On Your Site

Поділитися
Вставка
  • Опубліковано 31 бер 2019
  • Grab Your Free 17-Point WordPress Pre-Launch PDF Checklist: wplearninglab.com/17-point-wp...
    Check out the free WP & Online Marketing Summit For Beginners. The online event is June 18, 2019: events.wplearninglab.com/
    Something annoying about reCAPTCHA v3 when added to Contact Form 7, is that its' badge is added to every page of your website automatically.
    There is no way to turn it off in the reCAPTCHA v3 settings.
    Luckily, Travis and Steven provided solutions to all our UA-cam viewers and I'm sharing those solutions in this video.
    Blog post with the code: wplearninglab.com/hide-recapt...
    Child theme setup: • WordPress Child Theme ...
    Contact form 7 playlist: • WordPress Child Theme ...
    Join our private Facebook group today! / wplearninglab
    Here's how to setup Contact Form 7 reCAPTCHA v3: • FIXED Contact Form 7 r...
    //*
    Here are 20+ reasons why I host all my sites with SiteGround: wplearninglab.com/siteground-...
    //*
    Post videos of your WordPress success using the hashtag #WPLLCommunity!
    Grab your free 17-Point WordPress Pre-Launch PDF Checklist: vid.io/xqRL
    Download your exclusive 10-Point WP Security Checklist: bit.ly/10point-wordpress-harde...
    I hope this information helps you! If you have any questions leave a comment below or ping me @WPLearningLab on Twitter.
    WP Learning Lab Channel: ua-cam.com/users/subscription_c...

КОМЕНТАРІ • 117

  • @anamazanova
    @anamazanova 3 роки тому +12

    I inserted the code inside the child theme functions file. The invisible reCaptcha didn't work. It is still showing everywhere on the website.

  • @bcarse1
    @bcarse1 5 років тому +2

    Bjorn, This is exactly what I needed. Been getting a lot of spam marketing submissions from my contact form. Did exactly as you suggested by editing the functions.php and it worked flawlessly. Thanks for your help. Every single time I've asked you for help or advice, you've delivered. Your UA-cam channel is the first place I go when looking for WordPress help, tutorials or challenges. I'm never disappointed. Thanks again.

    • @wplearninglab
      @wplearninglab  5 років тому +1

      Awesome! I'm happy it worked without a problem Bruce and thanks for your kind words. Thanks for watching!

  • @coachshekher1792
    @coachshekher1792 3 роки тому

    Being a beginner I was so pissed off when I saw recaptcha on every page but you made me do this so easily. Thank you so much dear.

  • @kymmoulds
    @kymmoulds 4 роки тому +1

    Hey, thanks for the time to make this video, it's really appreciated. I went with the functions options and it works great for my small business web site. A BIG thumbs up and thanks again.

  • @sonyaj9333
    @sonyaj9333 5 років тому +1

    Thank you once again for providing a tutorial video that is easy to understand and follow. I truly appreciate the way that you explain the reasoning behind the code and how its placement and usage affects your site. Hope all is well for you!

  • @IanJones-ht3kk
    @IanJones-ht3kk 4 роки тому +2

    Brilliant! Thank you! I used the PHP modification and it worked like a dream.

    • @wplearninglab
      @wplearninglab  4 роки тому

      You're welcome Ian, thanks for watching! Let me know if you have any questions :)

  • @succeedwithcarl
    @succeedwithcarl 3 роки тому

    Very helpful! Worked like a treat. Thanks!

  • @capobandido
    @capobandido 4 роки тому

    Excellent! Thanks a lot. I've been able to solve my problem, greetings from Argentina

  • @muratsendogdu4599
    @muratsendogdu4599 5 років тому

    Allah razı olsun. Çok işime yaradı.

  • @gisellekeys6438
    @gisellekeys6438 4 роки тому +2

    SO easy to follow, thank you!

    • @wplearninglab
      @wplearninglab  4 роки тому

      You’re welcome Giselle, thanks for watching!

  • @WolverineMKD
    @WolverineMKD 5 років тому +1

    Thank you :) Great tutorial :)

    • @wplearninglab
      @wplearninglab  5 років тому +1

      Thanks for watching Wolverine 😀

  • @NoamSomech
    @NoamSomech 5 років тому

    As usual great work, thanks a lot!
    Please notice- While pasting the CSS code, I also got the extra dot.

  • @theloudcrymissionaries6822
    @theloudcrymissionaries6822 3 роки тому

    Helpful video, it works! :)

  • @tahokangas4998
    @tahokangas4998 5 років тому

    Thank you Bjorn for that :)

  • @georgejacob3348
    @georgejacob3348 3 роки тому +2

    I integrate Google Captcha to Contact7 form. I tried your PHP code (seen on seek position 02:53) but that code doesn't restrict functionality of Captcha other than "contact-us" page

  • @ataturkyusuf
    @ataturkyusuf 3 роки тому

    That was a great help.

  • @azontoboynate
    @azontoboynate 4 роки тому +1

    This stopped working for me the last week. Have any changes been made? Thanks for sharing this by the way.

  • @surfero66
    @surfero66 4 роки тому

    Awesome! Thanks

  • @RoleparaLeigos
    @RoleparaLeigos 4 роки тому

    Thanks bro!

  • @TravelTrained
    @TravelTrained 3 роки тому

    Hi, thanks for the video. Im not sure I have understood. recaptcha is a bit pissing me off because it slows down the entire website. With these lines of codes you basically remove the script from the website and it only stays on the contact page and it keeps doing the job or is only hidden from viewers but it still loads the script and slows down the entire website ? Thanks!

  • @jitx2797
    @jitx2797 3 роки тому +2

    This is the code that works From June
    add_action('wp_print_scripts', function () {
    //Add pages you want to allow to array
    if ( !is_page( array( 'contact','some-other-page-with-form' ) ) ){
    wp_dequeue_script( 'google-recaptcha' );
    wp_dequeue_script( 'wpcf7-recaptcha' );
    //wp_dequeue_script('google-invisible-recaptcha');
    }
    });

    • @Rasemule
      @Rasemule 3 роки тому +1

      Work fine! Thank you alot!

  • @toinevanderwielen9508
    @toinevanderwielen9508 5 років тому +1

    Thank u very much. That’s awesome.

    • @wplearninglab
      @wplearninglab  5 років тому

      You're welcome Toine, thanks for watching! Let me know if you have any questions :)

    • @toinevanderwielen9508
      @toinevanderwielen9508 5 років тому

      WordPress Tutorials - WPLearningLab
      Well.... I tried it yesterday but my website gave an error 500 and I could not reach it anymore.
      I am now waiting for the backup from my hosting!

  • @alexio6205
    @alexio6205 4 роки тому

    Thank you, i was using the css version to hide it but today i realized that it was adding 310kb on every page! I used the php code and it's really gone.
    On the other hand, having it only in one page kind of beats the functionality. They use it on every page in order to check the user activity and determine if it's a bot or real person. Having it only in one page, i don't know how good it will work but i will keep an eye on it.

  • @hmsaconsultancy7024
    @hmsaconsultancy7024 4 роки тому +3

    I added the code via functions.php but the badge is still showing up on every page, any idea? How to resolved this?

    • @navid7174
      @navid7174 3 роки тому +1

      Hi Hmsa,
      I find the solution so you can use the code below to add in function.php
      //Remove Google ReCaptcha code/badge everywhere except the pages where Contact form 7 plugin is loaded
      add_action( 'wp_enqueue_scripts', 'custom_load_contact_form_resources', 1 );
      function custom_load_contact_form_resources() {
      global $post;
      if ( isset( $post ) && is_singular() && has_shortcode( $post->post_content, 'contact-form-7' ) ) {
      return;
      }
      remove_action( 'wp_enqueue_scripts', 'wpcf7_do_enqueue_scripts' );
      remove_action( 'wp_enqueue_scripts', 'wpcf7_recaptcha_enqueue_scripts' );
      }
      Please let me know if it works out ;)

    • @hmsaconsultancy7024
      @hmsaconsultancy7024 3 роки тому

      @@navid7174 Hi, the code you gave above works, Thank you. It hides the recaptcha badge from all other pages and shows only on contact pages where contact form 7 loads. However, only for this page: hmsaconsultancy.com/contact-us/ the recaptcha badge is not showing. Would really appreciate if you could check and reply. Thanks!

    • @MirzaKhalid
      @MirzaKhalid 3 роки тому +1

      @@navid7174 I used your code and it works and removed all the recaptcha symbol from all pages but it also removed from Contact Us Form as well.

  • @britainreynolds7365
    @britainreynolds7365 3 роки тому +1

    Thank you this worked!

    • @wplearninglab
      @wplearninglab  3 роки тому

      You’re welcome, I’m happy I could help. Thanks for watching!

  • @EDOUIRIYassinee
    @EDOUIRIYassinee 5 років тому

    Thank you

  • @subinbabu1121
    @subinbabu1121 5 років тому +2

    Thank you🙂

    • @wplearninglab
      @wplearninglab  5 років тому +1

      You're welcome Subin, thanks for watching :)

  • @CristaldeAmanecer
    @CristaldeAmanecer 4 роки тому +1

    Muchas gracias!

  • @secondhandmerchandise
    @secondhandmerchandise 5 років тому

    not working in php... Can I use the old one v2? on my contact form are will it break the site?

  • @BrunoSLuz-yi8gi
    @BrunoSLuz-yi8gi 4 роки тому

    Show!! Thanks!

  • @Spain2brain
    @Spain2brain 5 років тому +2

    Thank you sooooooo much :) its working

    • @wplearninglab
      @wplearninglab  5 років тому

      You're welcome, thanks for watching! Let me know if you have any questions :)

    • @raanabukhari1077
      @raanabukhari1077 5 років тому

      Apv3

  • @d3m3tr3s
    @d3m3tr3s 4 роки тому

    I have two websites; in the first one worked perfect. I literally copy/paste the code from one functions file to the second website, but is not working. I also disabled the cache plugin, but still not working. Any ideas? I really don't want to use the CSS option!!! Please help! Just to help you a little more, the one website is not working, I'm using the flatsome theme. The functions file of this theme, has only one line of code "require get_template_directory() . '/inc/init.php';", compared to the other which is far from an "empty" file.

  • @mattfisher401
    @mattfisher401 4 роки тому

    Can you do a video that removes the "G Recaptcha Response" from submitted forms ("Contact Form 7" and "Contact Form 7 Send All Fields" plugins)? I get ALL the fields for my form now (which is great and EASY!) but it comes with a HUGE string of extra characters. It's not a major problem-I have the info I need-but it's unsightly and I like to keep things tidy.

  • @kieranmathieson8280
    @kieranmathieson8280 3 роки тому +1

    Another way to keep the captcha icon thing on the contact page, but not on every other page. Using only CSS.
    On the contact page, check out the body tag, and look for the class that uniquely identifies that page. For me it was page-id-8. (There may be another class that's better.) Add CSS like this to the global CSS:
    .grecaptcha-badge {
    display: none;
    }
    body.page-id-8 .grecaptcha-badge {
    display: block;
    }

  • @bobmiller7862
    @bobmiller7862 3 роки тому

    Does adding the code to the functions.php file prevent reCAPTCHA calls from all non-contact form pages, thus reducing the number of total requests reported in the Google reCAPTCHA admin console for the domain?

  • @FahadMehar
    @FahadMehar 5 років тому +1

    Thanks It works ! 😊

    • @wplearninglab
      @wplearninglab  5 років тому +1

      You're welcome Fahad, thanks for watching! Let me know if you have any questions :)

  • @gokselalkan
    @gokselalkan 4 роки тому

    good job thanks

  • @sahamanojphotography4715
    @sahamanojphotography4715 4 роки тому +1

    The css is not working in my site. I have also put !important with the css, but recaptcha still showing up.
    Is there any other way to remove the recaptcha?

    • @wplearninglab
      @wplearninglab  4 роки тому

      Hi Saha,
      If the CSS isn't working you can try the PHP option that I've outlined in the same video.

  • @ZOIDTHEFILMINGROBOT
    @ZOIDTHEFILMINGROBOT 4 роки тому +1

    Bloody brilliant

  • @darkbluebossa
    @darkbluebossa 5 років тому +1

    Cool. Thank you. Do you know if it´s possible with WPForms too?

    • @wplearninglab
      @wplearninglab  5 років тому

      No problem Gustavo. It should be possible. The selectors may be different, but the code will work. I would try it as it is first.

    • @darkbluebossa
      @darkbluebossa 5 років тому

      @@wplearninglab Thanks for the reply. I will try it and I will let you know :)

  • @khashayardadkhah5365
    @khashayardadkhah5365 5 років тому +1

    perfect tnx a lot

    • @wplearninglab
      @wplearninglab  5 років тому

      You're welcome Khashayar, thanks for watching!

  • @shirleyverstraete5710
    @shirleyverstraete5710 5 років тому +1

    Thank again for a video that not only addresses how to do something but also how to fix something! I do have 2 things I have questions about.
    1. After completing the Integration of reCaptcha in Contact Form 7, I also saw no button on my Contact Form 7 to add recaptcha above the Submit button. So I typed it in. Does that make a difference?
    2. After adding the add_action script to my functions.php file the Recaptcha pop-up displays correctly on the Contact form however it also still display on random pages - not all, just a few. I'm wondering should I have left the text "some-other-page-with-form" in the script? I left it in, due to in the future I'll be implementing a registration form for the site at which time I'll add the slug/s for that page to the script.

    • @wplearninglab
      @wplearninglab  5 років тому

      Hi Shirley,
      1. With reCAPTCHA v3 you don't need to add the reCAPTCHA shortcode to the form builder, it's applied automatically to all forms.
      2. I'm not sure why it would be adding it to random pages. It shouldn't be because you removed "some-other-page-with-form" from the array. I'll have to look into it. It's worth a try to add "some-other-page-with-form" back in and see if that fixes it.
      I hope that helps :) Let me know if you have any further questions. Thanks for watching!

    • @shirleyverstraete5710
      @shirleyverstraete5710 5 років тому +1

      @@wplearninglabThanks for quick reply.
      1. I will remove the [recaptcha] from the form. Who knows maybe that will fix #2. LOL!
      2. I believe I did try removing it and putting that back in and neither worked.
      I also will keep looking at it.

    • @wplearninglab
      @wplearninglab  5 років тому

      Do you know if the random pages for problem #2 are all pages or all posts or all custom post types? Or is it a random mix of page types?

    • @shirleyverstraete5710
      @shirleyverstraete5710 5 років тому

      @@wplearninglab It was a random mix of pages and posts - don't have custom posts on site. HOWEVER - I think I found the problem - it was a conflict with the PaidMembership Pro plug-in, which I've now deactivated.
      So to recap my situation - reCaptcha v3 is integrated with Contact Form 7; I've added the add action script to my functions.php file without 'some-other-page-with-form' and the aforementioned plug-in is still deactivated. I'm beginning to believe that my hosting server may have a time delay for making changed files active. I'll continue to watch this. I hope the badge will display on Contact form displays in a little while. Thanks for your continued interest - I'll keep you posted.

  • @immtl9882
    @immtl9882 3 роки тому +1

    I used this (option to not have the badge load on specific pages) and it was working great until a few days ago. I messed around with my WP Super Cache settings to try to improve site performance, and suddenly the badge came back on all pages. I can't figure out how to get this to work again. I even deleted WP Super Cache completely but it makes no difference. Coincidentally, my site was upgraded to WP 5.5 around the same time, so I'm also wondering if that might be the problem. Any thoughts?

    • @wplearninglab
      @wplearninglab  3 роки тому

      First things first, have you checked to make sure the code you used is still there?

    • @immtl9882
      @immtl9882 3 роки тому

      Yes. It's in the child theme, plus I went and added it in the main theme just in case. The badge still shows up on all pages.

  • @Gamingfortnite1234
    @Gamingfortnite1234 3 роки тому

    Why is not working with longer code maybe theme it self not allow me any suggestions ? Thanks

  • @styzoom
    @styzoom 4 роки тому

    So now you have 200 likes, it worked for me but why do I need that badge to show on my contact form? For looks?

  • @salah56477
    @salah56477 4 роки тому +1

    I'm a bit confused here... If I disable it from ALL pages even the contact page using function.php code method... Can reCAPTCHA still doing its "main job"??

    • @styzoom
      @styzoom 4 роки тому

      I just asked him too, I have it disabled on all pages. Is this sufficient or is not working anymore?

  • @jaypee.
    @jaypee. 4 роки тому +1

    thanks

    • @wplearninglab
      @wplearninglab  4 роки тому

      You’re welcome Mr John, thanks for watching!

  • @DoSocialge
    @DoSocialge 3 роки тому +1

    Hi, Great tutorial. But I don't understand it just hides Recaptcha but it works or after incejting css recaptcha is disabled?

    • @wplearninglab
      @wplearninglab  3 роки тому +1

      I hope I understand your question. Hiding the badge does not disable recaptcha because the badge isn’t the recaptcha, it’s really just advertising for the plugin.

    • @DoSocialge
      @DoSocialge 3 роки тому

      @@wplearninglab Exactly what i have asked. Thank you so much 👍

  • @GeorgeSprouse
    @GeorgeSprouse 5 років тому +3

    If the css code is not working for you add !important. This fixed my problem.
    .grecaptcha-badge {
    display: none !important;
    }

  • @seohsuae6927
    @seohsuae6927 4 роки тому +1

    This broke my site after deleting cache
    please help

  • @sanwalmanzoor6892
    @sanwalmanzoor6892 3 роки тому +1

    The Php method didn't work for me. :(

  • @billclarksynthesis
    @billclarksynthesis 5 років тому +6

    I added the code via functions.php but the badge is still showing up on my homepage and no other pages, any ideas?

    • @navid7174
      @navid7174 3 роки тому

      Hi Bill,
      I find the solution so you can use the code below to add in function.php
      //Remove Google ReCaptcha code/badge everywhere except the pages where Contact form 7 plugin is loaded
      add_action( 'wp_enqueue_scripts', 'custom_load_contact_form_resources', 1 );
      function custom_load_contact_form_resources() {
      global $post;
      if ( isset( $post ) && is_singular() && has_shortcode( $post->post_content, 'contact-form-7' ) ) {
      return;
      }
      remove_action( 'wp_enqueue_scripts', 'wpcf7_do_enqueue_scripts' );
      remove_action( 'wp_enqueue_scripts', 'wpcf7_recaptcha_enqueue_scripts' );
      }
      Please let me know if it works out ;)

    • @MirzaKhalid
      @MirzaKhalid 3 роки тому

      @@navid7174 yes it works but it removed the ReCaptcha Symbol from Contact Form unfortunately

    • @AkmaAit
      @AkmaAit 3 роки тому

      @@MirzaKhalid could you solve it?

    • @MirzaKhalid
      @MirzaKhalid 3 роки тому +1

      @@AkmaAit I had to remove the code entirely because it disabled the entire recaptcha feature in the form unfortunately

    • @AkmaAit
      @AkmaAit 3 роки тому

      @@MirzaKhalid got it Mirza, thanks. What is your solution though?

  • @priskakellykelly6523
    @priskakellykelly6523 3 роки тому

    i did follow each steps of your tutorial and now i cannot access my wordpress anymore . each time i try access it it tells me ERROR: Please solve Captcha correctly and i cannot login to my wordpress . i am so desperate now i do not know how to fix this . the recaptcha sign is not showing anywhere . first video i did follow from you after i did so well . and first disaster . do you have a solution for this please ?

  • @AchrafDakdak1
    @AchrafDakdak1 3 роки тому

    Hello,
    I tried the php code last year and it worked perfectly. Now, I got back here because the badge reappeared and I happened to come back to this great video. I checked the function's file. Although the PHP code is still in there, the badge is visible. Any idea, please?
    Looking forward to hearing from you,
    Kind regards

    • @Rasemule
      @Rasemule 3 роки тому +3

      Try this code, it seems to work for me:
      add_action('wp_print_scripts', function () {
      //Add pages you want to allow to array
      if ( !is_page( array( 'contact','some-other-page-with-form' ) ) ){
      wp_dequeue_script( 'google-recaptcha' );
      wp_dequeue_script( 'wpcf7-recaptcha' );
      //wp_dequeue_script('google-invisible-recaptcha');
      }
      });

    • @Rasemule
      @Rasemule 3 роки тому

      @@benherre no problem, glad I could help

    • @roottargz
      @roottargz 2 роки тому

      @@Rasemule This code worked for me too. Thanks.

  • @arivaansoftware
    @arivaansoftware 5 років тому +2

    Kindly tel me, how to write this code on wp admin login.

    • @wplearninglab
      @wplearninglab  5 років тому

      Do you want the badge to only appear on the login page?

    • @mamcastro
      @mamcastro 4 роки тому

      Bjorn, great Video! I pot the code at my child theme functions.php and it worked. I also want to know how to add the wp-admin login page, please. So, im my case, it must apear in two pages of the site and also at the loging page. Thank you.

  • @moobluz8912
    @moobluz8912 3 роки тому +1

    where can i find the dashboard website?

    • @wplearninglab
      @wplearninglab  3 роки тому

      I’m sorry, I’m not sure what you mean. Do I mention a dashboard websites somewhere in this tutorial?

  • @PaRd_CrYpToHec
    @PaRd_CrYpToHec 3 роки тому

    Didnt work, used 0 opacity instead but still appears on mobile devices...

  • @ysfpresents4952
    @ysfpresents4952 3 роки тому

    the .php code is not working on my site...

  • @dozegamin8604
    @dozegamin8604 Рік тому

    this is not stop loading, it just hides the recaptcha, that it still loading.

  • @lchaulk5534
    @lchaulk5534 2 роки тому

    there is an error on your site you linked to solve this issue, so u can no longer access it

  • @GlobalMusicMayhem
    @GlobalMusicMayhem 3 роки тому

    None of these worked for me in 2020. If these are not working for you. Add these lines into your contact forms at the bottom of the form:
    This site is protected by reCAPTCHA and the Google
    Privacy Policy and
    Terms of Service apply.
    [submit "Send"]
    then add this line to your custom css
    .grecaptcha-badge {
    visibility: hidden;
    }

  • @binodtharu5554
    @binodtharu5554 5 років тому +1

    No please no please no no

  • @mestazapodjetja7504
    @mestazapodjetja7504 4 роки тому

    This has to be April 1st joke, right?

  • @Duke49th
    @Duke49th 2 роки тому

    The php version doesn't work for me. not sure if it is the theme or a plugin.
    However, with the page id there is a pure css version. (thanks to someone in the comments - I cannot see the comment anymore and my reply on him was gone too)
    I also have a scroll up button on the right side, exactyl where the recaptcha appears. So I set the z-index higher than that...which is by default 2000 I believe.
    .grecaptcha-badge { }
    .grecaptcha-badge {
    display: none;
    }
    body.page-id-7 .grecaptcha-badge {
    display: block;
    z-index:4000;
    }

  • @thedoctor16
    @thedoctor16 7 місяців тому +1

    Thank-you! All, a better css than in the comments to get all but one page: body (### is you page id number, of course):not(.page-id-###) .grecaptcha-badge {display: none;}