Title: exclude JavaScript files and inline JavaScript from optimization
Last modified: August 24, 2021

---

# exclude JavaScript files and inline JavaScript from optimization

 *  Resolved [alekv](https://wordpress.org/support/users/alekv/)
 * (@alekv)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/exclude-javascript-files-and-inline-javascript-from-optimization-2/)
 * Hi
 * Is there a way to programmatically exclude certain scripts (enqueued and inline)
   from optimization?
 * Thanks
    Aleksandar

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

 *  Plugin Author [Gabe Livan](https://wordpress.org/support/users/gabelivan/)
 * (@gabelivan)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/exclude-javascript-files-and-inline-javascript-from-optimization-2/#post-14801338)
 * [@alekv](https://wordpress.org/support/users/alekv/) There’s no particular hook
   attached to the exclusion areas (e.g. _“Settings” -> “Optimize CSS” -> “CSS Files
   Minification” -> “Do not minify the CSS files matching the patterns below (one
   per line):”_). Are you interested in adding things like IF clauses to exclude
   certain scripts from getting minified (or altered in any way)? As far as I recall,
   this has never been requested.
 * I’d like more information about what you want. The more you can provide to me,
   the better as I could think of something.
 *  Thread Starter [alekv](https://wordpress.org/support/users/alekv/)
 * (@alekv)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/exclude-javascript-files-and-inline-javascript-from-optimization-2/#post-14802186)
 * I’m also a plugin developer myself ([woopt WooCommerce Pixel Manager)](https://wordpress.org/plugins/woocommerce-google-adwords-conversion-tracking-tag/),
   currently debugging an install where the scripts of my plugin are not being inserted
   into the website. At the moment I am not sure if it is because of Asset Cleanup(
   there are other possible causes I’m looking into). But if it is, I would like
   to exclude my plugins scripts from Asset Cleanup programmatically, solving this
   not just for that install but for every install that is using my and your plugin.
 *  Plugin Author [Gabe Livan](https://wordpress.org/support/users/gabelivan/)
 * (@gabelivan)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/exclude-javascript-files-and-inline-javascript-from-optimization-2/#post-14805313)
 * [@alekv](https://wordpress.org/support/users/alekv/) you said: “_currently debugging
   an install where the scripts of my plugin are not being inserted into the website_”–
   Asset CleanUp never prevents any scripts by default from being loaded. Everything
   is loaded and you can select to unload them. Check the “Overview” area from Asset
   CleanUp which has all the unload rules. Perhaps, on some pages, the scripts that
   you mentioned were marked for unloading.
 * “_I would like to exclude my plugins scripts from Asset Cleanup programmatically,
   solving this not just for that install but for every install that is using my
   and your plugin_”
    You could exclude them by removing the unload rules (if any).
   Otherwise, there’s _no exclusion_ to make as none shouldn’t have occurred in 
   the first place.
 *  Thread Starter [alekv](https://wordpress.org/support/users/alekv/)
 * (@alekv)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/exclude-javascript-files-and-inline-javascript-from-optimization-2/#post-14806338)
 * Thanks!

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

The topic ‘exclude JavaScript files and inline JavaScript from optimization’ is 
closed to new replies.

 * ![](https://ps.w.org/wp-asset-clean-up/assets/icon-256x256.png?rev=1981952)
 * [Asset CleanUp: Page Speed Booster](https://wordpress.org/plugins/wp-asset-clean-up/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-asset-clean-up/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-asset-clean-up/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-asset-clean-up/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-asset-clean-up/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-asset-clean-up/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [alekv](https://wordpress.org/support/users/alekv/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/exclude-javascript-files-and-inline-javascript-from-optimization-2/#post-14806338)
 * Status: resolved