Resolving issues with Minify CSS files
To resolve display issues that may occur when Minify CSS files is active, please follow these steps:
- Go to the Get Page Resources online tool.
- Enter the URL of the page with the CSS issue.
- Click on the Get Non-cached Page Resources button.
- In the left sidebar, click on CSS > External CSS Files to get the list of the CSS stylesheets on your site:
- Copy the list of CSS files, then go to WP Rocket Settings > File Optimization and paste the list into the Minify CSS files > Excluded CSS Files field:
- Save the settings and check your site, in a logged-out or incognito window. It should now be displaying correctly.
- Now remove each file from the list, one-at-a-time. After each removal, save the settings and check your site. Repeat this until the website is broken again.
- When the website breaks, replace the last removed file back into the list and move onto the next file.
Note: this method can also be used for issues with Minify/Combine JavaScript files (using the JavaScript > External scripts results in the Get Page Resources tool), but the method described here is faster.
Excluding files from external domains
Files from external domains can be excluded either by the domain name or the full file URL. e.g. to exclude: https://bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css
You may use either: bootstrapcdn.com
or https://bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css
Heads up!
Certain patterns of exclusions cannot be handled and are automatically removed.
If you add them, you should see a notice with the "WP Rocket: The following patterns are invalid and have been removed" message.
Please see more in our Invalid patterns of exclusions article.