Skip to content

Minification

Minification rewrites a CSS or JavaScript file without the comments, spaces and long names a browser does not need, so the same code downloads smaller. It is not compression and it is not combining files. WordPress already ships its own files minified.

By
WP Ministry
Published

In short

  • Minifying makes each file smaller. Compressing packs it for the journey. Combining joins files into one. They are three separate settings.
  • WordPress loads minified versions of its own scripts and stylesheets. What is left to minify belongs to themes and plugins.
  • The saving is a size, not a time. Measure the page before and after, and keep the setting only if the figures move.

Minification rewrites a CSS or JavaScript file without the parts a browser does not need in order to run it: comments, spaces and line breaks, and in JavaScript the long names of variables and functions. The file does the same job and is smaller to download.

It is one of three things that are often named together.

What it doesWhat the browser receives
MinificationStrips comments and spacing out of each fileThe same files, each a little smaller
CompressionThe server packs each file with gzip or Brotli to send it, and the browser unpacks itThe same files, smaller in transit
CombiningJoins several files into one. Also called concatenatingFewer files, with the same bytes in total

Minifying and compressing add up. A compressor looks for repeated patterns in any text. It does not know that a comment can be thrown away, so a minified file still gains on a server that compresses.

Where you meet it

  • File names. A minified file usually has .min in its name, as in style.min.css. WordPress loads the minified versions of its own scripts and stylesheets. Setting the SCRIPT_DEBUG constant to true in wp-config.php makes it load the full versions, which is meant for people changing those files. The default is false.
  • PageSpeed Insights. Two audits, "Minify CSS" and "Minify JavaScript", each list the files that are not minified, with a possible saving in kibibytes (KiB). Lighthouse 13 replaced many audits with insights in October 2025. These two stayed, under the same names.
  • A caching or optimization plugin. Look for the settings with minify in their names, and treat any setting for combining as a separate decision.
  • wp-config.php. CONCATENATE_SCRIPTS controls WordPress's own combining of JavaScript on administration screens.

What goes wrong

  • Something breaks after the setting is switched on. Switch it off, clear the cache and test one setting at a time. WordPress's own documentation suggests turning its concatenation off when JavaScript fails on an administration screen. How to minify CSS and JavaScript in WordPress covers finding the file to leave out.
  • There is little left to gain. WordPress's files are minified already, and so, as a rule, is any file a theme or plugin ships with .min in its name. The figure in the audit is an estimate of size, not of time saved.
  • It is mistaken for compression. A site can minify every file and still send them all uncompressed. See how to enable gzip and Brotli compression.
  • It is expected to make a page react faster. A minified script downloads and parses sooner. It still does the same work when it runs. For a page that is slow to respond to a tap, see how to fix Interaction to Next Paint.
  • It is expected to stop a file from blocking the page. A minified stylesheet in the head is still one of the render-blocking resources.

Several of the plugins in WordPress caching plugins compared have minify settings.

Common questions

Is minification the same as gzip compression?

No. Minification rewrites the file itself, and the smaller file is the one that is served. Compression packs a file as it is sent and the browser unpacks it on arrival.

Does WordPress minify files by itself?

Only its own. WordPress ships minified versions of the scripts and stylesheets that come with it and loads those. It loads a theme's or a plugin's files as their author shipped them.

Can minification break a site?

It should not, because it removes only what the browser does not need. When a page breaks after an optimization setting is switched on, test with combining switched off first, since that changes how the files are joined and requested.

Not sure what is wrong?

Tell us what you see. We reply with the cause and a fixed quote, and the diagnosis is free.