Title: Combine JavaScript Files
Last modified: May 7, 2021

---

# Combine JavaScript Files

 *  Resolved [belbe](https://wordpress.org/support/users/belbe/)
 * (@belbe)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/combine-javascript-files-2/)
 * Hi there,
    I need to activate ‘Combine JavaScript Files’ however when I do so
   most of the content of my home page disappears, most images, tables, plus more.
   Headers and footers, sliders, and some other things remain. Can you assist? Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcombine-javascript-files-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Stoyan Georgiev](https://wordpress.org/support/users/stoyangeorgiev/)
 * (@stoyangeorgiev)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/combine-javascript-files-2/#post-14412636)
 * Hey there [@belbe](https://wordpress.org/support/users/belbe/),
 * You can use the Exclude from JavaScript Combination functionality to exclude 
   any scripts that are not functioning properly after the optimization is enabled.
 * If you have any issues after that, feel free to reach back to us.
 * Kind regards,
    Stoyan
 *  Thread Starter [belbe](https://wordpress.org/support/users/belbe/)
 * (@belbe)
 * [5 years ago](https://wordpress.org/support/topic/combine-javascript-files-2/#post-14455766)
 * Hi Stoyan,
    Thanks for that, I have attempted to action this advice and have 
   experimented with excluding all the scripts that appear in the drop down menu,
   and also with excluding certain combinations of scripts. I have been successful
   in getting most of the content to reappear however there are three items which
   I cannot get to function with JavaScript Combination option enabled – all images(
   except background images & vid thumbs), Gravity Forms plug in and mobile drop
   down menu under ‘client portal’. Do you have any advice on that? I believe some
   of the scripts I need to exlude are not appearing in the drop down menu, however
   I don’t know how to exclude those manually. I have currently left the site without
   JavaScript Combination enabled at all. Thanks again, Belbe
 *  Plugin Author [Stoyan Georgiev](https://wordpress.org/support/users/stoyangeorgiev/)
 * (@stoyangeorgiev)
 * [5 years ago](https://wordpress.org/support/topic/combine-javascript-files-2/#post-14456548)
 * Hey there [@belbe](https://wordpress.org/support/users/belbe/),
 * If a script is not present in the dropdown menu, you can exclude the 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_exclude', 'js_combine_exclude' );
       function js_combine_exclude( $exclude_list ) {
           $exclude_list[] = 'script-handle';
           $exclude_list[] = 'script-handle-2';
   
           return $exclude_list;
       }
       ```
   
 * Most of the time, the reason for a script not being present in the exclude dropdown
   is because it was not enqueued properly. In those cases you can use the filters
   we have provided for that purpose.
 * Kind regards,
    Stoyan

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

The topic ‘Combine JavaScript Files’ 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
 * 2 participants
 * Last reply from: [Stoyan Georgiev](https://wordpress.org/support/users/stoyangeorgiev/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/combine-javascript-files-2/#post-14456548)
 * Status: resolved