How to hide the Google Invisible reCAPTCHA badge

前端 未结 15 2209
感情败类
感情败类 2020-12-02 04:15

When implementing the new Google Invisible reCATPTCHA, by default you get a little \"protected by reCAPTCHA\" badge in the bottom right of the screen that pops out when you

15条回答
  •  借酒劲吻你
    2020-12-02 04:49

    If you are using the Contact Form 7 update and the latest version (version 5.1.x), you will need to install, setup Google reCAPTCHA v3 to use.

    by default you get Google reCAPTCHA logo displayed on every page on the bottom right of the screen. This is according to our assessment is creating a bad experience for users. And your website, blog will slow down a bit (reflect by PageSpeed Score), by your website will have to load additional 1 JavaScript library from Google to display this badge.

    You can hide Google reCAPTCHA v3 from CF7 (only show it when necessary) by following these steps:

    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 );
    }
    

    Refer on OIW Blog - How To Remove Google reCAPTCHA Logo from Contact Form 7 in WordPress (Hide reCAPTCHA badge)

提交回复
热议问题