@domreed12,
I’m sure SiteGround will answer your questions soon. Until then, please know that it’s not possible to exclude files from external sources (e.g., Google).
However, you can try to exclude them using the filter(s) provided by SiteGround in the homepage of this forum. You may also need to use the method that is “pinned” at the top of this Support Thread.
Best wishes!
Hello there @domreed12,
If you wish to exclude an external script from the JS Combination, you can use the following filter we’ve created.
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';
$exclude_list[] = 'script-host-2.com';
return $exclude_list;
}
You just have the change she scripts host inside the function with the one you desire.
It’s best to put that code snippet inside the functions.php file of a child theme, so it does not get overwritten when updated.
Kind regards,
Stoyan
Thread Starter
Anonymous User 17958263
(@anonymized-17958263)
Thanks both, I will give that a try 🙂