Title: How to exclude inline JavaScript?
Last modified: March 22, 2021

---

# How to exclude inline JavaScript?

 *  Resolved [alekv](https://wordpress.org/support/users/alekv/)
 * (@alekv)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/how-to-exclude-inline-javascript/)
 * Hi
 * Is there a way to exclude inline JavaScript from being combined and minified?
 * Thanks
    Aleks

Viewing 1 replies (of 1 total)

 *  Plugin Author [Stoyan Georgiev](https://wordpress.org/support/users/stoyangeorgiev/)
 * (@stoyangeorgiev)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/how-to-exclude-inline-javascript/#post-14218724)
 * Hello there [@alekv](https://wordpress.org/support/users/alekv/),
 * You can exclude inline script from being combined using the filter we’ve designed
   for that purpose. Here’s an example of the code:
 *     ```
       add_filter( 'sgo_javascript_combine_excluded_inline_content', 'js_combine_exclude_inline_script' );
       function js_combine_exclude_inline_script( $exclude_list ) {
           $exclude_list[] = 'first few symbols of inline content script';
   
           return $exclude_list;
       }
       ```
   
 * If you wish to exclude a specific script from minification, you can use this 
   one:
 *     ```
       add_filter( 'sgo_js_minify_exclude', 'js_minify_exclude' );
       function js_minify_exclude( $exclude_list ) {
           $exclude_list[] = 'script-handle';
           $exclude_list[] = 'script-handle-2';
   
           return $exclude_list;
       }
       ```
   
 * Kind Regards,
    Stoyan

Viewing 1 replies (of 1 total)

The topic ‘How to exclude inline JavaScript?’ 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [Stoyan Georgiev](https://wordpress.org/support/users/stoyangeorgiev/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/how-to-exclude-inline-javascript/#post-14218724)
 * Status: resolved