I've been working on a site where specific CSS files have been written and loaded only when required. I would like to combine all those scripts into one single file. I'm not interested in minifying or compressing, though the first one may be good.

I've tested so many cache and compression mechanisms unsuccessfully including W3 Cache or WP-Minify (that it is not updated since years now).

Isn't there a simple procedure to do this, interacting with the wp_styles variable?

This script available at the url below sounds promising, but doesn't work as it is https://gist.github.com/bainternet/1802367

Any idea?

  • If neither W3 Cache nor the script at GitHub worked for you, then I would submit that there may be an issue with your file(s) (probably javascript). I've actually written a php script that does exactly this for an MVC framework (not WP), and was able to make it work, but like you, never had any luck getting W3 Cache to work properly in WP (and never took the time to investigate my javascript files). When you say "doesn't work" - what specifically happens (or doesn't happen)? Jun 7, 2014 at 22:48
  • Well, I'm not referring to JS at all here as I know this can be a different beast. I'm just referring to CSS files. As a matter of fact, I dind't go throught the github code in detail. I just notice the implementation as a plugin break the admin interface, possibly because it attempts to attach to the wrong method. But I didn't investigate more than that as I don't want to reinvent the wheel. Jun 8, 2014 at 8:46

1 Answer 1


After many attempts, I found this plugin that implente the Google Minify solution to work fine. I guess this is the best way to go other than reinveinting the wheel.

I've choosen this one because it allows to change the Minify script bahvior from the WP panel.

  • The link is broken... do you have any alternate link / source location?
    – Mr_Green
    Apr 15, 2019 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.