Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Can you try simply adding google.com/recaptcha instead?

    Thread Starter 4090

    (@4090-1)

    Thanks for the suggestion. Unfortunately it did not work.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, when looking at your HTML source I do see https://www.google.com/recaptcha/api.js being deferred;

    <script type='text/javascript' defer='defer' src='https://www.google.com/recaptcha/api.js?render=6Lc0IuMUAAAAACCV8sFRZKua3UIMUvAHOpU8dGWp&ver=3.0' id='google-recaptcha-js'></script>

    so _that_ part is working correctly ??

    Thread Starter 4090

    (@4090-1)

    Thanks.

    Unfortunately, I could not get it to work with Async Javascript and added a modified script

    add_filter( ‘script_loader_tag’, function ( $tag, $handle ) {
    if ( ‘google-recaptcha’ !== $handle ) {
    return $tag;
    }
    return str_replace( ‘ src’, ‘ defer=\’defer\’ src’, $tag ); // defer the script
    }, 10, 2 );

    to my theme’s functions.php

    Unfortunately, it is still showing as not deferred in gtmetrix.com so I have not really gotten any further.

    Thanks for your help.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    yeah, recaptcha is a known pain-in-the-performance-butt .. :-/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Defer reCAPTCHA for Contact form 7’ is closed to new replies.