Recaptcha loading on every page except contact form
-
Hi
I need some help regarding the recaptcha loading on every page. The previous posts are like 1 year to 3 years old.
I tried the following code with the older posts below:// Add custom Theme Functions here
/* CONTACT FORM 7 */// Stop the CF7 CSS & JS FROM LOADING ON EVERY PAGE
add_filter( ‘wpcf7_load_js’, ‘__return_false’ );
add_filter( ‘wpcf7_load_css’, ‘__return_false’ );function disable_google_recaptcha_except_contact()
{
//Remove the captcha scripts if its not on the contact form
if (!is_page(array( ‘contact’)) ) :
wp_dequeue_script(‘wpcf7-recaptcha’);
wp_dequeue_script(‘google-recaptcha’);
else :// else if it is the contact form enqueue all the scripts related to CF7
if (function_exists(‘wpcf7_enqueue_scripts’)) {wpcf7_enqueue_scripts();
}if (function_exists(‘wpcf7_enqueue_styles’)) {
wpcf7_enqueue_styles();
}
endif;}
add_action(‘wp_enqueue_scripts’, ‘disable_google_recaptcha_except_contact’);`
But it did not work. My setup is using Contact->integration with google captcha
Please helpThe page I need help with: [log in to see the link]
- The topic ‘Recaptcha loading on every page except contact form’ is closed to new replies.