Title: Exclude Javascript/CSS from Processing
Last modified: February 8, 2024

---

# Exclude Javascript/CSS from Processing

 *  Resolved [avong](https://wordpress.org/support/users/avong/)
 * (@avong)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-javascript-css-from-processing/)
 * When JS “**Exclude Javascript from Processing**” or CSS “**Exclude the following
   CSS from Processing**“, the output of the excluded JS/CSS resource strips everything“?
   ver=12345” even though it’s been defined in the wp_enqueue_script or wp_enqueue_style
   functions.
 * Eg. “[https://example.com/wp-content/themes/example_theme/assets/css/style.min.css?ver=ySnI0lPz6W&#8217](https://example.com/wp-content/themes/example_theme/assets/css/style.min.css?ver=ySnI0lPz6W&#8217);
   when define as being excluded under **“Exclude Javascript from Processing**” 
   with “wp-content/themes/”, it outputs the HTML tag with the src “[https://example.com/wp-content/themes/example_theme/assets/css/style.min.css&#8221](https://example.com/wp-content/themes/example_theme/assets/css/style.min.css&#8221);.
   
   This is a massive problem due to most websites are serving static resources with
   long expiry dates for this assets. With the query “?ver=12345” stripped, this
   remove the developers intend to force updated of the resource on the CDN and 
   client’s browsers cache.
 * [https://i.ibb.co/tKhzNvc/wp-optimize-issue.png](https://i.ibb.co/tKhzNvc/wp-optimize-issue.png)

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

 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-javascript-css-from-processing/#post-17410814)
 * You should not be putting the minified files in the exclude from processing, 
   only the un-minifed files should be added to stop them being minified.
 *  Thread Starter [avong](https://wordpress.org/support/users/avong/)
 * (@avong)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-javascript-css-from-processing/#post-17444433)
 * Disregard the minified and un-minified references. 
   The issue is related to the
   scripts being excluded are removing the version attribute as defined in “wp_register_script”
   or “wp_enqueue_script” and “wp_register_style” or “wp_enqueue_style” WP functions.
   Example:
 *     ```wp-block-code
       wp_enqueue_script( 'some_js', '/path/to/foo.js',array(), '1.0.0');
       ```
   
 * 
   This should output the HTML (without WP-Optimize minify enabled)
 *     ```wp-block-code
       <script type="text/javascript" src="https:/example.com/wp-content/themes/example-theme/js/foo.js?ver=1.0.0" id="some_js"></script>
       ```
   
 * But when ‘wp-content/themes/’ is set as one of exclusion paths under WP-Optimize
   Minify, the “**_?ver=1.0.0_**” at the end is removed:
 *     ```wp-block-code
       <script type="text/javascript" src="https:/example.com/wp-content/themes/example-theme/js/foo.js" id="some_js"></script>
       ```
   
 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-javascript-css-from-processing/#post-17447023)
 * I have checked this on one of my sites, you only kept the version bit (**_?ver
   =1.0.0_**) on minified scripts
 *  Thread Starter [avong](https://wordpress.org/support/users/avong/)
 * (@avong)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-javascript-css-from-processing/#post-17447363)
 * That’s right. The minified scripts and css is fine, but scripts and css files
   on WP Optimize Exclusion list isn’t.
   So any JS and CSS on WP Optimize exclusion
   lists should be left as is and (**_?ver=1.0.0_**) should be kept as is and not
   being removed . This is very important and hope your developers can resolve this
   asap.
 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/exclude-javascript-css-from-processing/#post-17454369)
 * The files added to the exclusion list should not have the ver=1.0.0 on the end
   as they are not minifed (you only get this on files that have been minified)
 * If your file has this on the end, it has already been minified and thus there
   is no point in excluding it.
 *  Thread Starter [avong](https://wordpress.org/support/users/avong/)
 * (@avong)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/exclude-javascript-css-from-processing/#post-17470558)
 * Sorry, I think you’re still not understanding the issue. 
   What I’m referring 
   to is anything in the exclusion list should not be manipulated by WP Optimize.
   Therefore, when a theme or a plugin enqueue’s a JS or CSS file via standard WP
   function, the SRC (JS) or HREF (CSS) should not be modified in any form or any
   string being stripped out.
 * Can you please take a bit more time to understand the issue raised and perhaps
   refer this to someone more technical/senior in the team to understand/resolve
   the issue?
    - [https://developer.wordpress.org/reference/functions/wp_enqueue_style/](https://developer.wordpress.org/reference/functions/wp_enqueue_style/)
    - [https://developer.wordpress.org/reference/functions/wp_enqueue_script/](https://developer.wordpress.org/reference/functions/wp_enqueue_script/)
 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/exclude-javascript-css-from-processing/#post-17473501)
 * I will check with my colleague and get back to you
 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/exclude-javascript-css-from-processing/#post-17476466)
 * We have created an internal ticket to investigate this further
 *  Thread Starter [avong](https://wordpress.org/support/users/avong/)
 * (@avong)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/exclude-javascript-css-from-processing/#post-17519663)
 * Any updates from internal ticket?
 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/exclude-javascript-css-from-processing/#post-17521601)
 * Hi,
 * I am afraid there is no update at the moment. It is in our to do list. My advice
   would be to check the change log when an update becomes available.

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

The topic ‘Exclude Javascript/CSS from Processing’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/exclude-javascript-css-from-processing/#post-17521601)
 * Status: resolved