• Resolved Generosus

    (@generosus)


    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;
    }

Viewing 1 replies (of 1 total)
  • Plugin Support Pavel Dosev

    (@pdosev)

    Hello @generosus,

    There is no built-in filter in WordPress that allows you to exclude a JavaScript file like jquery-core on a per-page basis, such as only for the WP-Admin and WP-Login pages. The filter you’ve mentioned (sgo_js_async_exclude) applies site-wide and cannot be limited to specific URLs or pages within the admin area.

Viewing 1 replies (of 1 total)
  • The topic ‘Exclude JS Files From Async | Only WP-Admin and WP-Login Pages’ is closed to new replies.