• Resolved Sam-wa

    (@sam-wa)


    Our site loads the following file in the footer and we want to exclude it from JavaScript Combination.

    https://static.zdassets.com/ekr/snippet.js (Zendesk chat widget)

    However, the file is not listed in the drop-down list in the Siteground optimizer plugin. So we can not exclude it.

    Is there a fix for this?

    Thanks!

    • This topic was modified 5 years, 4 months ago by Sam-wa.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hello there @sam-wa,

    You can exclude external script from being combined using the filter we’ve designed for that purpose. Here’s an example of the code, you can add to your functions.php file:

    add_filter( 'sgo_javascript_combine_excluded_external_paths', 'js_combine_exclude_external_script' );
    function js_combine_exclude_external_script( $exclude_list ) {
        $exclude_list[] = 'script-host.com';
    
        return $exclude_list;
    }

    If you are having any difficulties, feel free to contact us again!

    Kind regards,
    Stoyan

    Thread Starter Sam-wa

    (@sam-wa)

    Awesome!
    This worked like a charm.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Exclude from JavaScript Combination Doesn’t Work’ is closed to new replies.