Filters to Exclude JS Combination and Deferral (Per Page Basis)

Good Day,

We are using Speed Optimizer to combine all of our JS files and the deferral of all render-blocking files, including jQuery. It’s working great. However, we need filters to exclude the combination and deferral of jQuery on one of our pages (say, “custom-login-page“). What filters can we use?

For example, the following filters are not working for us:

add_action( 'wp_footer', function () {

if ( ! is_page('custom-login-page') ) return;

add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude_login' ); 
function js_combine_exclude_login( $exclude_list ) { 

$exclude_list[] = 'jquery-core'; 

return $exclude_list; }

} );
add_action( 'wp_footer', function () {

if ( ! is_page('custom-login-page') ) return;

add_filter( 'sgo_js_async_exclude', 'js_async_exclude_login' ); 
function js_async_exclude_login( $exclude_list ) {

$exclude_list[] = 'jquery-core';

return $exclude_list;
}

} );

Note: Our page, “custom-login-page“, is our mask for our “wp-admin” login page.

Thank you.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer