Title: Autoptimize breaking some scripts
Last modified: August 22, 2016

---

# Autoptimize breaking some scripts

 *  Resolved [mxpimp47](https://wordpress.org/support/users/mxpimp47/)
 * (@mxpimp47)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-breaking-some-scripts/)
 * I am testing the plugin to minify all the plugin files in my wordpress install.
   I have all of my own template css/js minified already and wanted to minify things
   one step further that my site is dependent upon. When I checked the boxes for
   css/js in the autoptimize settings it broke some small scripts I have. One is
   for a small instagram widget in my sidebar which now doesn’t display any content.
   And also the facebook like box doesn’t show now. What should I do to resolve 
   this? Here is my test site beta.freestonemx.com
 * Thanks, Clayton
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

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

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-breaking-some-scripts/#post-5945904)
 * evening clayton;
    you should exclude those scripts from being autoptimized, [see the FAQ](https://wordpress.org/plugins/autoptimize/faq/)
   for more info on configuration & troubleshooting.
 * hope this helps,
    frank
 *  Thread Starter [mxpimp47](https://wordpress.org/support/users/mxpimp47/)
 * (@mxpimp47)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-breaking-some-scripts/#post-5945935)
 * Thank you for the help, I read the FAQ, and added the exclude like this wp-content/
   themes/fmx/build/js/main.min.js, but it still didnt work. Even tried checking
   the box for try-catch wrapping. Is that not the correct way to exclude it?
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-breaking-some-scripts/#post-5945959)
 * it is (although I would just put “js/main.min.js”, but if for example main.min.
   js depends on jquery, then you’ll also logically have to exclude jquery.min.js(
   or jquery.js). look at your browser’s error console to see what error(s) are 
   thrown, that should help you troubleshoot.
 * frank
 *  Thread Starter [mxpimp47](https://wordpress.org/support/users/mxpimp47/)
 * (@mxpimp47)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-breaking-some-scripts/#post-5945991)
 * I have tried every combination I can think of from using full dir name to just
   js/main.min.js. I excluded jquery-ui.min.js too, and still couldnt get anything
   to change after save and clear cache. These are the files listed in console with
   errors –
 * jquery-ui.min.js?ver=4.1.1:5 Uncaught ReferenceError: jQuery is not defined
    
   main.min.js?ver=4.1.1:1 Uncaught TypeError: Cannot read property ‘fn’ of undefined
   bootstrap.min.js?ver=3.3:6 Uncaught Error: Bootstrap’s JavaScript requires jQuery
   notes-common-v2.js?ver=3.4.1-201513:158 Uncaught ReferenceError: jQuery is not
   defined admin-bar-v2.js?ver=3.4.1-201513:2 Uncaught ReferenceError: _ is not 
   defined autoptimize_06588244889d1af6479c9e81a1be3801.js:8 Uncaught TypeError:
   undefined is not a function
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-breaking-some-scripts/#post-5945992)
 * Well, “jQuery is not defined” indicates jquery was not excluded (correctly), 
   so that would be my main angle for bugfixing 🙂
 *  Thread Starter [mxpimp47](https://wordpress.org/support/users/mxpimp47/)
 * (@mxpimp47)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-breaking-some-scripts/#post-5945994)
 * I added just
 * > jquery.js
 *  and all the errors went away. When you are logged in there are some console 
   errors related to the admin bar stuff. But that shouldnt be as critical should
   it? I checked when logged out and there were none, and everything functioned 
   as expected.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-breaking-some-scripts/#post-5946001)
 * great!
 * regarding admin-bar-stuff; if that doesn’t bother you, you can leave that as 
   is. if it does bother you, “_ is not defined” indicates that underscore is to
   be excluded 🙂
 *  [funsail](https://wordpress.org/support/users/funsail/)
 * (@funsail)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/autoptimize-breaking-some-scripts/#post-5946210)
 * jquery/jquery.js

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

The topic ‘Autoptimize breaking some scripts’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 8 replies
 * 3 participants
 * Last reply from: [funsail](https://wordpress.org/support/users/funsail/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/autoptimize-breaking-some-scripts/#post-5946210)
 * Status: resolved