Reducing the Number of Minified Files

By default, WP Rocket combines minified files into little groups for better compatibility and performance.

However, if you would like to combine all CSS into one big file and/or all JS into one big file, we have an option for that (v2.6+). You will find it in the Advanced Options tab:

Option field: Reduce the number of minified files in one file

Programatic Approach (Previous to v2.6)

You can use a filter to override the default behavior and combine CSS and JS in one big file. Paste this code into a custom MU plugin, or into the functions.php of your theme:

add_filter( 'rocket_minify_filename_length', '__rocket_minify_one_file' );
function __rocket_minify_one_file( $length ) {
	return PHP_INT_MAX;
}

It is also possible to specify CSS or JS. In this example, we will combine only the CSS into one big file (JS will be combined in little groups):

add_filter( 'rocket_minify_filename_length', '__rocket_minify_one_file_for_css', 10, 2 );
function __rocket_minify_one_file_for_css( $length, $ext )  {
	if( $ext == 'css' ) {
		$length = PHP_INT_MAX;
	} 
	return $length;
}