Last active
January 21, 2020 20:21
-
-
Save mingodev/4a365721fc002cb31c45f9d56d4e73f1 to your computer and use it in GitHub Desktop.
Remove recaptcha from most pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Remove Google ReCaptcha code/badge everywhere apart from select pages | |
add_action('wp_print_scripts', function () { | |
//Add pages you want to allow to array | |
if ( !is_page( array( 'slugs-go-here' ) ) ){ | |
wp_dequeue_script( 'google-recaptcha' ); | |
//wp_dequeue_script( 'google-invisible-recaptcha' ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment