B-219 Sec-55 Noida, India
+918010221733

Remove Contact Form 7 scripts elsewhere

To Remove Contact Form 7 scripts elsewhere except the pages using the Contact form 7 copy the below code to your functions.php

// Add the Contact Form 7 scripts on selected pages

function add_wpcf7_scripts() {

if ( is_page(array(60)) )

wpcf7_enqueue_scripts();

}

// Remove Contact Form 7 scripts elsewhere

if ( ! is_admin() && WPCF7_LOAD_JS )

remove_action( ‘wp_print_scripts’, ‘wpcf7_enqueue_scripts’ );

add_action( ‘wp’, ‘add_wpcf7_scripts’ );

(Visited 62 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.