Speed & performance · Info
W3 Total Cache Minify Settings Explained: What Each Option Does

Short answer
W3 Total Cache minify settings remove spaces and comments from HTML, CSS and JavaScript and can combine files to speed up pages. Turn minify on in General Settings, start with Auto mode and minify only for scripts, then test each change and exclude any file that breaks.
Key takeaways
- Minify is enabled in General Settings and tuned on the Minify page.
- Auto mode suits most sites; Manual mode gives full control.
- JavaScript minify and combining cause most layout problems.
- Defer is usually safer than async for scripts that depend on each other.
- Exclude individual files instead of turning minify off completely.
What do the W3 Total Cache minify settings do?
W3 Total Cache minify settings shrink your HTML, CSS and JavaScript by removing spaces and comments, and can combine files, so pages download and render faster.
Minify is turned on in Performance > General Settings and fine-tuned on the Performance > Minify page. It is one of the most effective settings in the plugin and also the one most likely to break a layout if pushed too far.
This page explains each minify option in plain language and suggests safe starting values. Option labels can shift a little between plugin versions, so match them to what you see on your screen. For the plugin's other settings, see our W3 Total Cache recommended settings guide.
How do you turn on minify in W3 Total Cache?
Go to Performance > General Settings, tick Minify in the Minify section, choose a minify mode and cache method, then save.
In that section you will see:
- Minify. The master switch.
- Minify mode. Auto or Manual (explained below).
- Minify cache method. Where minified files are stored, usually Disk on shared hosting.
- HTML minifier, JS minifier, CSS minifier. Which engine does the work for each file type.
Leave the minifier engines on their defaults unless you have a specific reason. The default engines are the most widely used and need no extra setup.
If you use a CDN or another plugin that already minifies files, such as Cloudflare or your host's optimizer, turn minify on in only one place. Doing it twice wastes resources and can cause errors.
What is the difference between Auto and Manual minify mode?
Auto mode finds and processes your CSS and JavaScript files for you, while Manual mode makes you list exactly which files to minify and combine.
| Mode | How it works | Best for |
|---|---|---|
| Auto | Detects files on each page and processes them | Most sites, quick setup |
| Manual | You add each file and its position by hand | Developers wanting full control |
Auto is easier and works for most sites. Its weakness is that some themes and plugins load scripts in an order that breaks when combined.
Manual mode avoids surprises because nothing is processed unless you add it. The trade-off is time: you must add files again when themes or plugins change. The plugin's minification FAQ covers the details of each mode.
What do the HTML and XML minify settings do?
These settings remove whitespace and comments from the page's HTML, and can also minify CSS and JavaScript written directly inside the page.
Options in the HTML & XML section:
- Enable. Minifies the HTML output. Usually safe.
- Inline CSS minification. Shrinks style blocks inside the page.
- Inline JS minification. Shrinks script blocks inside the page. This is more likely to break things, so test carefully.
- Don't minify feeds. Leaves RSS feeds untouched. Keep it on.
- Line break removal. Removes line breaks as well as spaces. Small gain, slight extra risk.
- Ignored comments. Comments to keep, such as markers that some plugins or ad scripts need.
HTML minify saves only a little, since servers already compress HTML. It is still a cheap win on most sites.
What do the JavaScript minify settings do?
The JS section lets you minify and combine script files, choose how they are loaded, and remove comments and line breaks.
Main options:
- Enable. Turns on JS minification.
- Minify method. Combine and minify, minify only, or combine only. Minify only is the safest starting point.
- Embed type. How the combined script is added to the page. Choices include the default blocking load and non-blocking options such as async and defer.
- Embed location. Before the closing head tag, after the opening body tag, or before the closing body tag (Manual mode).
- Preserved comment removal and Line break removal. Small extra savings.
Loading scripts with defer usually improves render speed without breaking order, because deferred scripts still run in sequence. Async runs scripts as soon as they arrive, which can break scripts that depend on each other, such as jQuery plugins.
MDN explains the difference between async and defer clearly. Our guide on deferring JavaScript in WordPress covers the wider options.
What do the CSS minify settings do?
The CSS section minifies stylesheets, can combine them into fewer files, and decides how @import rules are handled.
Options include:
- Enable. Turns on CSS minification.
- Combine only. Joins files without minifying them. Useful if minifying breaks something but you still want fewer requests.
- Preserved comment removal and Line break removal.
- @import handling. Choose whether imported stylesheets are processed, moved to the top, or left alone. Process is usually fine.
CSS minify is generally safer than JS minify. The most common problem is broken font or image paths when files move into the cache folder. If icons or background images vanish after enabling CSS minify, that is the first thing to check.
Minify does not remove unused CSS. That is a separate task, covered in our guide to removing unused CSS in WordPress.
What do the advanced minify settings do?
The Advanced section controls how often external files are refreshed, when old minified files are cleaned up, and which pages, files and user agents to skip.
- Update external files every. How often W3TC fetches fresh copies of external scripts it includes.
- Garbage collection interval. How often old minified files are deleted from the cache.
- Never minify the following pages. URLs to skip entirely, such as checkout or account pages.
- Never minify the following JS files and CSS files. Exclude specific files that break when minified.
- Rejected user agents. Visitors or bots that should receive the original files.
The exclusion boxes are your main tool for fixing problems. When one script breaks, exclude that file instead of turning off minify for everything.
Which W3 Total Cache minify settings are safest to start with?
Start with Auto mode, HTML minify on, CSS minify on, and JS set to minify only with the default embed type, then test before adding combining or defer.
A cautious setup:
- HTML: Enable on, inline JS minify off.
- CSS: Enable on, combining on if nothing breaks.
- JS: Enable on, minify only, default blocking embed.
- Test your home page, a post, forms, menus and the cart or checkout if you have a store.
- Then try defer for JavaScript and test again.
Change one setting at a time and clear the cache after each change. Our guide on clearing W3 Total Cache shows how. Measure the result with a tool like Lighthouse; Chrome's documentation on render-blocking resources explains what the scores mean.
How do you fix problems caused by minify?
Turn off JS minify first, since it causes most issues, then turn settings back on one by one and exclude the specific file or page that breaks.
Common symptoms and fixes:
- Sliders, menus or popups stop working. A JavaScript file breaks when combined or deferred. Switch to minify only, or exclude the file.
- Layout looks unstyled. CSS failed to load. Check the browser console for 404 errors on minified files and make sure the cache folder is writable.
- Icons or fonts missing. Paths broke after combining. Exclude the font or icon stylesheet.
- Admin bar or editor broken while logged in. Check whether minify is disabled for logged-in users.
Your browser's developer console shows which file failed. Once you know the file name, add it to the Never minify list.
Should you use W3 Total Cache minify or another tool?
Use W3TC minify if it is your only optimization tool, but turn it off if your host, CDN or another plugin already minifies files.
Many hosts and CDNs now handle minification at the server or edge. Running two minifiers at once can cause double processing, odd errors and harder troubleshooting.
If you want a simpler interface, some caching plugins bundle minify and defer in fewer settings. W3TC gives more control, which is great once you understand each option. You can read more about the plugin as a whole in our W3 Total Cache overview, and the plugin page on WordPress.org lists its current features.
Frequently asked questions
Should I use Auto or Manual minify mode?
Start with Auto mode. It detects files for you and works for most sites. Switch to Manual only if Auto keeps breaking scripts and you are comfortable listing each file yourself. Manual needs updating whenever your theme or plugins change the files they load.
Why did my site break after enabling minify?
Most breakage comes from JavaScript being combined or loaded in the wrong order. Turn off JS minify, confirm the site works, then turn it back on with minify only. If one file still breaks, add it to the Never minify JS files list.
Does minify make a big difference to speed?
It helps, but the gain is usually modest because servers already compress files. Combining files and deferring scripts can have a bigger effect on render speed. Page caching, image optimization and good hosting tend to matter more overall.
Can I use W3 Total Cache minify with Cloudflare?
You can, but avoid minifying in two places. If Cloudflare or your host already minifies files, leave W3 Total Cache minify off. If you rely on W3 Total Cache for it, make sure other services are not also changing the same files.
Why are my icons missing after minifying CSS?
Combining stylesheets moves them into the cache folder, which can break relative paths to icon fonts and background images. Exclude the icon or font stylesheet from minify, or use combine only. Clear all caches after the change and reload in a private window.
Sources
- W3 Total Cache WordPress.org
- FAQ: Minification W3 Total Cache on GitHub
- The Script element MDN Web Docs
- Eliminate render-blocking resources Chrome for Developers
- Minification MDN Web Docs
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


