Exclude JS Files From Async | Only WP-Admin and WP-Login Pages

[ad_1]

Good Day,

We would like to apply the filter below only to our WP-Admin and WP-Login pages. Can you kindly provide a code snippet to acccomplish that?

For some reason, your plugin is also affecting those pages when it shouldn’t. We already confirmed the filter provided below fixes our jQuery issue on those pages, but is hurting all other website pages (i.e., jQuery is render-blocking).

Thank you!

———-

add_filter( 'sgo_js_async_exclude', 'js_async_exclude_acl' );
function js_async_exclude_acl( $exclude_list ) {
$exclude_list[] = 'jquery-core';
return $exclude_list;
}

 

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