Title: Exclude javascript from optimize
Last modified: September 30, 2021

---

# Exclude javascript from optimize

 *  Resolved [Huy Hoa](https://wordpress.org/support/users/huyhoanet/)
 * (@huyhoanet)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/exclude-javascript-from-optimize/)
 * Hi,
    Thanks for your optimized plugin. I have a problem need your help please.
   I have a script something like this: (of course this is not full code but the
   start of the snippet)
 *     ```
       <script type="application/ld+json">{"@context":"http://schema.org","@type":"CreativeWorkSeries"
       ```
   
 * When i added it in the header.php then SGOptimized automaticcly move it to footer
   then it dupplicated and then one in header and one in footer.
    If i move that
   code to footer, then it will be ok, only one in the footer. So, now i want to
   put it in the header.php and exclude it from moving to footer and i use this 
   snippet.
 *     ```
       add_filter( 'sgo_javascript_combine_excluded_inline_content', 'js_combine_exclude_inline_script' );
       function js_combine_exclude_inline_script( $exclude_list ) {
           $exclude_list[] = '<script type="application/ld+json">{"@context":"http://schema.org","@type":"CreativeWorkSeries"';
           return $exclude_list;
       }
       ```
   
 * But there is no change. Could you please check if i did something wrong?
    Thank
   you so much
    -  This topic was modified 4 years, 8 months ago by [Huy Hoa](https://wordpress.org/support/users/huyhoanet/).

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

 *  Plugin Author [Stoyan Georgiev](https://wordpress.org/support/users/stoyangeorgiev/)
 * (@stoyangeorgiev)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/exclude-javascript-from-optimize/#post-14927194)
 * Hey there [@huyhoanet](https://wordpress.org/support/users/huyhoanet/),
 * This script should not be combined, because when checking the inline scripts,
   we skip the ones that do not have an **src** attributes.
 * Would it be possible to provide a site URL, so we can investigate the issue in
   detail and locate the exact issue for that behavior?
 * Kind regards,
    Stoyan
 *  Thread Starter [Huy Hoa](https://wordpress.org/support/users/huyhoanet/)
 * (@huyhoanet)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/exclude-javascript-from-optimize/#post-14930087)
 * > Would it be possible to provide a site URL, so we can investigate the issue
   > in detail and locate the exact issue for that behavior?
 * Hi, Stoyan
    Thanks for your support. I don’t want to show it here, so, which 
   email should I send to? Or can I create a ticket inside my Siteground account?
 *  Plugin Author [Hristo Pandjarov](https://wordpress.org/support/users/hristo-sg/)
 * (@hristo-sg)
 * SiteGround Representative
 * [4 years, 8 months ago](https://wordpress.org/support/topic/exclude-javascript-from-optimize/#post-14930519)
 * We can’t communicate over the email, since it’s against the rules. Please, open
   another thread and provide your site URL in it if you want us to look further
   into this. It will be unavailable for bots and unregistered users anyway if that’s
   the concern. Otherwise, I am afraid we can’t assist you further.

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

The topic ‘Exclude javascript from optimize’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Hristo Pandjarov](https://wordpress.org/support/users/hristo-sg/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/exclude-javascript-from-optimize/#post-14930519)
 * Status: resolved