Viewing 4 replies - 1 through 4 (of 4 total)
  • Sate

    (@satestudio)

    @18tommyboy
    I am using this code in the functions.php

    // Contact Form 7 - Load Recaptcha only when Form is used
    add_action('wp_print_scripts', function () {
    	global $post;
    	if ( is_a( $post, 'WP_Post' ) && !has_shortcode( $post->post_content, 'contact-form-7') ) {
    		wp_dequeue_script( 'google-recaptcha' );
    		wp_dequeue_script( 'wpcf7-recaptcha' );
    	}
    });

    This loads recaptcha only when contact form is on the page.
    I hope this will help.

    Thread Starter 18TommyBoy

    (@18tommyboy)

    Thank You! This superb working.
    But still don´t know why it not implement to the code ContactForm7…

    Thread Starter 18TommyBoy

    (@18tommyboy)

    With theme autoupdate again coming back.
    And I not say, what an ugly is on mobile this Google logo…

    Sate

    (@satestudio)

    To make changes you should use a child theme so if you are updating the theme it doesn’t affect the functions file. I am not sure why this is not implemented in CF7.

    When it comes to the recaptcha logo. I think it is required by google to display it as it informs the user about recaptcha being in place. Additionally it links to the recaptcha Privacy Policy and Terms of use. I think you can hide it with css but only when you are going to inform your users that you are using recaptcha. I think more details about that can be found on recaptcha website.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Google recaptcha everywhere’ is closed to new replies.