WP-Mix

A fresh mix of code snippets and tutorials

Disable Combined Scripts in the WordPress Admin Area

If you’ve ever tried to debug JavaScript or CSS for pages in the WordPress Admin Area, you know that it’s next to impossible to sort out which files contain which scripts. Why? Because WordPress combines them all at runtime into a single, concatenated script. It’s referred to as concatenation, and it helps to reduce the overall number of HTTP requests and thus improve performance.

Gotta keep ’em separated..

So for developers who need to work with the JavaScript and CSS files individually, it is possible by adding the following line to your site’s wp-config.php file:

define( 'CONCATENATE_SCRIPTS', false );

Where to add that code in the wp-config.php file? Just above/before the line that says this:

That’s all, stop editing! Happy blogging.

Save changes and done. When in place, that code snippet tells WordPress to not combine all the scripts (i.e., JavaScript and CSS). So they will be included as individual assets. To restore default functionality, simply remove the line from wp-config.php or set the value to true.

Toots!

Learn more

Digging Into WordPressWordPress Themes In DepthWizard’s SQL Recipes for WordPress