Allow option to exclude analytics javascript froom Combine Javascript option

[ad_1]

Hello @joycekwc,

If the script you are trying to exclude is not present in the drop-down menu, you can exclude it by using SG Optimizer’s filters. You may find an example of code that can be used to exclude a certain script from the JS combination below:

add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );
function js_combine_exclude( $exclude_list ) {
    $exclude_list[] = 'script-handle';
    $exclude_list[] = 'script-handle-2';
    return $exclude_list;
}

Best Regards,
Daniela Ivanova

 

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