Title: minify JavaScript problem
Last modified: December 2, 2018

---

# minify JavaScript problem

 *  Resolved [Greg Robertson](https://wordpress.org/support/users/517design/)
 * (@517design)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/minify-javascript-problem/)
 * Great Plugin!
    When I turn on Minify JavaScript i get a good ranking in google
   pagespeed, but it breaks my theme. I took every js file i could find and included
   all of them in the Exclude Files List hoping my theme would not break and i could
   eliminate these files one by one until i found the js file that was causing the
   issue. Here are the files I used:
 *     ```
       https://staging.burialinsurance.life/wp-content/themes/visual-composer-starter/js/bootstrap/collapse.min.js
       https//www.google-analytics.com/analytics.js
       https:\/\/staging.burialinsurance.life\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.9.
       https://staging.burialinsurance.life/wp-includes/js/jquery/jquery.js?ver=1.12.4
       https://staging.burialinsurance.life/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1
       https://staging.burialinsurance.life/wp-json/https://staging.burialinsurance.life/wp-content/themes/visual-composer-starter/js/bootstrap/transition.min.js?ver=3.3.7
       https://staging.burialinsurance.life/wp-content/themes/visual-composer-starter/js/bootstrap/collapse.min.js?ver=3.3.7
       https://staging.burialinsurance.life/wp-content/themes/visual-composer-starter/js/slick/slick.min.js?ver=1.6.0
       https://staging.burialinsurance.life/wp-content/themes/visual-composer-starter/js/functions.min.js?ver=3.0
       https://staging.burialinsurance.life/wp-includes/js/wp-embed.min.js?ver=4.9.8
       https://staging.burialinsurance.life/wp-content/plugins/js_composer/assets/js/dist/js_composer_front.min.js?ver=5.6
       https://staging.burialinsurance.life/wp-content/plugins/ninja-forms/assets/js/min/front-end--inputmask.min.js?ver=3.3.19
       https://staging.burialinsurance.life/wp-includes/js/underscore.min.js?ver=1.8.3
       https://staging.burialinsurance.life/wp-includes/js/backbone.min.js?ver=1.2.3
       https://staging.burialinsurance.life/wp-content/plugins/ninja-forms/assets/js/min/front-end-deps.js?ver=3.3.19
       https://staging.burialinsurance.life/wp-content/plugins/ninja-forms/assets/js/min/front-end.js?ver=3.3.19
       https://staging.burialinsurance.life/wp-content/plugins/ninja-forms-style/layouts/assets/js/min/front-end.js?ver=3.0.25 
       ```
   
 * Screenshots of my settings:
    [https://gyazo.com/015448c44c0d9e1c34b14a9b37716735](https://gyazo.com/015448c44c0d9e1c34b14a9b37716735)
   [https://gyazo.com/3a90f25f4119f5d9d9a959f10b6f0a84](https://gyazo.com/3a90f25f4119f5d9d9a959f10b6f0a84)
   [https://gyazo.com/cfcffbd8b7cdc1886473a4d85dc23a2e](https://gyazo.com/cfcffbd8b7cdc1886473a4d85dc23a2e)
 * Is there a setting I need to change?
    Am I putting the js files in the Exclude
   Files List incorrectly or adding the wrong files?
 * Thanks, Greg
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fminify-javascript-problem%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Denis Ryabov](https://wordpress.org/support/users/dryabov/)
 * (@dryabov)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/minify-javascript-problem/#post-10938905)
 * As to the Exclude Files List, it is based on a partial matching, so it is sufficient
   to set just a path without protocol and domain name, e.g.
 *  /wp-content/themes/visual-composer-starter/js/bootstrap/collapse.min.js
 * (moreover, javascript files may be actually loading via relative paths)
 * And, of course, you can disable merging of javascript at all (but it would be
   better to found which file leads to the error and exclude them only).
 *  Thread Starter [Greg Robertson](https://wordpress.org/support/users/517design/)
 * (@517design)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/minify-javascript-problem/#post-10939117)
 * Thank you very much!
 *  Thread Starter [Greg Robertson](https://wordpress.org/support/users/517design/)
 * (@517design)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/minify-javascript-problem/#post-10947651)
 * Just to be thorough how do i find every js file my site is using?
 * and what about the scripts in the head that are not links, do i copy and paste
   the whole script into Exclude Files List?
 * thanks again
 *  Plugin Author [Denis Ryabov](https://wordpress.org/support/users/dryabov/)
 * (@dryabov)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/minify-javascript-problem/#post-10957184)
 * Currently there is no easy way to specify inlined script to don’t be merged, 
   except of disabling of merging of all inlined javascripts.
 * But there are two tricky ways:
    1) add ress-safe attribute to the script tag 
   to skip this js (allowing prior and next javascripts to be merged into a single
   file), and 2) add data-cfasync=false attribute to disable optimization of this
   js and preventing merging of prior and next javascripts to avoid possible dependence-
   related issues.
 *  Thread Starter [Greg Robertson](https://wordpress.org/support/users/517design/)
 * (@517design)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/minify-javascript-problem/#post-10959007)
 * Thanks I’ll try that

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

The topic ‘minify JavaScript problem’ is closed to new replies.

 * ![](https://ps.w.org/psn-pagespeed-ninja/assets/icon.svg?rev=1722219)
 * [PageSpeed Ninja - Cache, Minify, Defer CSS JavaScript, Critical CSS, Optimize Images, Convert WebP](https://wordpress.org/plugins/psn-pagespeed-ninja/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/psn-pagespeed-ninja/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/psn-pagespeed-ninja/)
 * [Active Topics](https://wordpress.org/support/plugin/psn-pagespeed-ninja/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/psn-pagespeed-ninja/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/psn-pagespeed-ninja/reviews/)

## Tags

 * [pagespeed ninja](https://wordpress.org/support/topic-tag/pagespeed-ninja/)

 * 5 replies
 * 2 participants
 * Last reply from: [Greg Robertson](https://wordpress.org/support/users/517design/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/minify-javascript-problem/#post-10959007)
 * Status: resolved