Title: Combine JavaScript Files breaks a small script
Last modified: November 19, 2020

---

# Combine JavaScript Files breaks a small script

 *  Resolved [e555](https://wordpress.org/support/users/e555/)
 * (@e555)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/combine-javascript-files-breaks-a-small-script/)
 * Hello. I have a javascript that basically does a document.write to display an
   image. Combine JavaScript Files prevents the image from showing. How can I exclude
   this script? It is not showing up on the list of scripts to exclude

Viewing 1 replies (of 1 total)

 *  Plugin Author [Stoyan Georgiev](https://wordpress.org/support/users/stoyangeorgiev/)
 * (@stoyangeorgiev)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/combine-javascript-files-breaks-a-small-script/#post-13686457)
 * Hello there [@e555](https://wordpress.org/support/users/e555/),
    If your script
   is inline you can use this filter to exclude it
 *     ```
       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;
       }
       ```
   
 * You can also use this one by adding your script handle:
 *     ```
       add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );
       function js_combine_exclude( $exclude_list ) {
           $exclude_list[] = 'script-handle';
   
           return $exclude_list;
       }
       ```
   
 * Depending on the case you can choose the one that suits best for you. Those code
   snippets can be added to your functions.php file. Keep in mind that it is better
   to put them in your child-themes functions.php. If you have any issues after 
   that feel free to contact us.
 * Kind regards,
    Stoyan
    -  This reply was modified 5 years, 6 months ago by [Stoyan Georgiev](https://wordpress.org/support/users/stoyangeorgiev/).
      Reason: Did not ping the participant when first added the comment

Viewing 1 replies (of 1 total)

The topic ‘Combine JavaScript Files breaks a small script’ 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, 6 months ago](https://wordpress.org/support/topic/combine-javascript-files-breaks-a-small-script/#post-13686457)
 * Status: resolved