Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Vincent Poirier

    (@magikweb)

    Has anybody had any luck with this? Not necessarily with Contact Form 7, but avoiding to load the whole Google reCaptcha in a static page that does not contain any form would be a decent upgrade. (Increase loading speed)

    You can add this code to functions.php to remove it from the home page or you can add a condition to remove it from all page except the page where you have Contact Form 7

    function conditionally_load_plugins() {
        // Remove from Home page
    	if(is_front_page()) {	
    		wp_dequeue_script('google-invisible-recaptcha');
    	}
    }
    add_action( 'wp_enqueue_scripts', 'conditionally_load_plugins' ); 
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Dequeue libraries when unneeded’ is closed to new replies.