Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save abid112/c944c38d86fcee9e81dd66c65cab2ea2 to your computer and use it in GitHub Desktop.
Save abid112/c944c38d86fcee9e81dd66c65cab2ea2 to your computer and use it in GitHub Desktop.
This is for the WordPress user who uses Contact Form-7 integration for reCAPTCHA v3 . Google introduced a new reCAPTCHA v3 which is run on the background of the webpage. So no need to perform that checkbox and stupid image puzzle anymore. Google detects automatically with their algorithm of Human or Bot. In reCAPTCHA v3 in Contact Form-7 is perf…
//For one page
add_action('wp_print_scripts', function () {
if ( !is_page('contact-us') ){
wp_dequeue_script( 'google-recaptcha' );
}
});
//For multiple pages
add_action('wp_print_scripts', function () {
if ( !is_page( array( 'contact-us', 'my-account', 'checkout') ) ) {
wp_dequeue_script( 'google-recaptcha' );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment