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, 3 months 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%2Fpage%2F2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 16 through 30 (of 36 total)

[←](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/?output_format=md)
[1](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/?output_format=md)
2 [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/3/?output_format=md)

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10078386)
 * not entirely sure why you had to “swap the `"` with `'` and vice versa”, but
 * `<script type='text/javascript' src='/wp-content`
    would match
 * `<script type='text/javascript' src='/wp-content/themes/appdev/js/libs/jquery.
   easing.1.3.js'></script>`
 * but
    `<script type="text/javascript" src="/wp-content`
 * would not.
 * what would work is (if you need to avoid the single quotes) is;
 *     ```
       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);
       }
       ```
   
 * or, if you only want single quotes;
 *     ```
       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);
       }
       ```
   
 * Question still being if that will solve the files not being aggregated off course…
 * frank
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10078488)
 * Hi Frank,
 * Yeah, I changed the single quote marks because my HTML appeared like this in 
   the browser:
 * `<script type="text/javascript" src="/wp-content/plugins/jetpack/modules/wpgroho.
   js"></script>`
 * So I was worried that `<script type='text/javascript' src='/wp-content` would
   not match anything. Not sure if that’s incorrect though? At any rate, the `str_replace`
   method didn’t work for me in either instance.
 * Thanks,
 * James
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10078645)
 * ok, we’ll have to shift gears here; do you have (or can you set up) a non-prod
   instance where we could experiment to the extent we could break things?
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10079772)
 * Well, we’re running UpdraftPlus on the site. I’m happy to let you play around
   with the live site, just backup before you make the changes. Does that work for
   you?
 * Thanks,
 * James
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10079794)
 * I can’t touch live-sites I’m afraid :-/
 * Any chance you could (get your hoster to) setup a staging-site?
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10079848)
 * Okay, my colleague’s now asking if we could send over the backup files. Would
   that work?
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10079856)
 * well, we can try 🙂
 * you can reach me at futtta-at-gmail-dot-com
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10082324)
 * Hi Frank,
 * I’ve emailed you the backup files this morning. Let me know if that works for
   you. If not, I’ll do what I can to get a Staging site set up. Thanks again for
   your help.
 * James
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10082375)
 * I’ll try to get things up and running on my local dev-machine 🙂
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10084960)
 * Did you have any luck with this?
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10084965)
 * not yet, still on my to-do list 🙂
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10084968)
 * One thing I found yesterday which might help, when I installed the Cloudflare
   plugin and activated that, the plugin settings were completely blank.
 *  Thread Starter [zetland](https://wordpress.org/support/users/zetland/)
 * (@zetland)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/2/#post-10084969)
 * Cool, thank you!
 *  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/page/2/#post-10243308)
 * Hey Frank, did you get anywhere with this one?
 * Thanks,
 * James
 *  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/page/2/#post-10243999)
 * Evening James;
    I was able to replicate the problem by activating the “make paths
   relative”-plugin that was in your zip-files, but if I remember correctly disabling
   it did not solve the problem for you? My gut feeling (based on this problem but
   also on cloudflare admin not working) that the installation is suffering from
   some weird issues which I feel might require a complete re-install of your site
   to fix.
 * Have a nice evening,
    frank

Viewing 15 replies - 16 through 30 (of 36 total)

[←](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/?output_format=md)
[1](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/?output_format=md)
2 [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/3/?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: [8 years, 1 month ago](https://wordpress.org/support/topic/autoptimize-not-concatenating-css-or-javascript/page/3/#post-10263672)
 * Status: not resolved