Title: Autoptimize not concatenating CSS or JavaScript
Last modified: February 25, 2018

---

# Autoptimize not concatenating CSS or JavaScript

 *  [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/)
 * Hey Frank,
 * Thanks for the excellent plugin and all your help here. I’ve been using Autoptimize
   for a while now and it’s been fine with my other sites, but I’ve now got one 
   that isn’t complying. I have optimize HTML, CSS and JavaScript all ticked, but
   it’s not concatenating CSS or JS. Do you know of something that could block this(
   plugin or wp-config.php code or anything else)? I’ve been toying around with 
   my setup but can’t get it to play ball so far…
 * Thanks,
 * James
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fautoptimize-not-concatenating-css-or-javascript%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 36 total)

1 [2](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/?output_format=md)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10012381)
 * well, there seems to be some JS/ CSS optimized and other not, weird … I guess
   a theme or plugin conflict, try identifying by disabling/ enabling plugins and/
   or switching a default theme to identify?
 * frank
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10012530)
 * Well, it’s worked with this theme in the past, so I don’t think that’s the issue.
   I’m disabling plugins now. There are a lot of them though. Do you have a list
   of ones which interfere with AO?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10012545)
 * > Do you have a list of ones which interfere with AO?
 * afraid not, no :-/
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10012871)
 * Just removed all plugins and checked in Incognito. It’s still doing the same 
   thing. Any other suggestions?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10012967)
 * and when switching themes [@zetland](https://wordpress.org/support/users/zetland/)(
   I know you wrote it worked before, but still to be absolutely sure …)
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10012975)
 * Well, this plugin used to work fine with my old theme, but let me take a look…
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10012983)
 * Yup, same problem
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10013036)
 * well, the only logical conclusion would be Autoptimize (and hence PHP and the
   user under which the PHP-process is running) cannot read those files from the
   filesystem, in which case AO indeed leaves the files in place (in order not to
   break anything). could that be the case somehow?
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10013078)
 * I’d be surprised if that were the case. How can I find out if it can’t read those
   files, and what could I do to fix it?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10013262)
 * 1. check the permissions of the files that are not aggregated on the server
    
   2. change the permission
 * but I see something that might help us find the root cause; your unoptimized 
   HTML has resources with a full URL, e.g.:
 *     ```
       <script type='text/javascript' src='https://vocularapp.com/wp-content/plugins/revslider/public/assets/js/jquery.themepunch.tools.min.js'></script>
       ```
   
 * and some without a full URL, e.g.:
 *     ```
       <script type='text/javascript' src='/wp-content/themes/appdev/js/libs/jquery.easing.1.3.js'></script>
       ```
   
 * and it looks as though the files that have a full URL are aggregated and the 
   ones that don’t have a full URL are not.
 * so, the question; what code is causing this difference? is it something you can
   turn off?
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10059708)
 * Hi Frank,
 * I’ll be honest, I’m not getting anywhere with this. Is there any chance I could
   enlist your help here? I’d be very happy to pay for your help, or make a charitable
   donation in your name as a token of gratitude.
 * Thanks,
 * James
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [8 years ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10062719)
 * OK, so to answer the question from your other post; AO should not bail on something
   like
 *     ```
       <script type='text/javascript' src='/wp-content/themes/appdev/js/libs/jquery.easing.1.3.js'></script>
       ```
   
 * (I tested on my local dev to be 100% sure).
 * Now this would just be a workaround, but maybe give this code snippet a try;
 *     ```
       add_filter('autoptimize_html_before_minify','vocularapp_fix');
       function vocularapp_fix($htmlIn) {
           return str_replace("<script type='text/javascript' src='/wp-content","<script type='text/javascript' src='https://vocularapp.com/wp-content",$htmlIn);
       }
       ```
   
 * frank
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10064897)
 * Hi Frank,
 * Thanks! I added this snippet to the AO code and then tried deactivating and reactivating
   it, looks like it’s not working yet though. Have I added the snippet to the wrong
   place?
 * James
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [8 years ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10064922)
 * ah, but you shouldn’t add that to the autoptimize code, use something like [code snippets](https://wordpress.org/plugins/code-snippets/)
   to add it instead 🙂
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/#post-10072897)
 * Thanks for your amazing patience with this. I’ve added that code as via Code 
   Snippets (although I had to swap the `"` with `'` and vice versa to match my 
   browser. I’m not seeing any differences though. Can you think of any reason why
   this might be? I’ve given it about 15 minutes to update, purged all my caches
   and done a hard refresh in Incognito…
 * James

Viewing 15 replies - 1 through 15 (of 36 total)

1 [2](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/?output_format=md)

The topic ‘Autoptimize not concatenating CSS or JavaScript’ 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/)

## Tags

 * [concatenation](https://wordpress.org/support/topic-tag/concatenation/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [js](https://wordpress.org/support/topic-tag/js/)

 * 36 replies
 * 3 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/3/#post-10263672)
 * Status: not resolved