Skip to main content

Asset Optimizer

FREE!

Premium performance — faster pages in minutes.

Combine and minify enqueued CSS and JavaScript, strip the rules nothing uses, right-size and convert your images, and fetch the next page before it is clicked — the asset optimization premium performance plugins charge for, free.

Asset Optimizer makes an existing WordPress site faster without changing how it looks. It combines your front-end CSS and JavaScript into cached files, removes the rules nothing on the page can use, fixes the image delivery problems that usually dominate a slow page, and can fetch the next page before a visitor clicks it.

Activate it from Unyson+ → Extensions, then open Unyson+ → Asset Optimizer. Its settings are in three tabs: General (everything below), CSS (which stylesheets to merge) and JavaScript (which scripts to merge).

💡 Web dev tip: measure, then change one thing

Every option here is a trade, and the right answer depends on your site. Take a baseline with PageSpeed Insights or WebPageTest, change one setting, and measure again. Two changes at once and you will not know which one helped — or which one hurt. See Performance.

Start here​

Most of it is already on. Activating the extension switches on everything that cannot change how a page looks without you noticing:

On out of the boxWhat it does
Combine CSS and JavaScriptFewer requests
CSS combining scope: Site-wideOne shared bundle, cached across pages
Serve WebP imagesUsually 25–80% off every photo
Generate missing image sizesStops phones downloading full-size originals
Preload the hero imageFinds the main image sooner
Inline small leftover stylesheetsRemoves the last few blocking requests
Defer combined scriptScripts stop blocking the first paint
Instant navigation: PrefetchThe next page is fetched before the click

Each of those is reversible and leaves your originals alone. So the honest first step is: activate it, look at your site, and measure.

Then, one at a time​

These are the faster settings, left off because each one can change how a page looks on a site nobody has checked yet. Turn on one, click through a few pages — open the menu, expand an accordion, hover the buttons — and measure before moving to the next:

  1. Remove unused CSS — usually the single biggest win, and the one whose mistakes are quietest. Add ?fw_ao_nopurge=1 to a URL to rule it in or out instantly.
  2. Serve AVIF images — another 28% under WebP. Off by default only because it works through your whole media library in the background, which is something to opt into rather than inherit.
  3. Inline the first screen's CSS and Move late CSS into the head — both rearrange when CSS arrives, so watch the top of a few pages as they load.
  4. Browser cache for static files — free for repeat visits, but it writes a block to wp-content/.htaccess, so it asks first by being off.

How it discovers assets​

To know what to combine, Asset Optimizer needs to see your front end render. It does a one-time internal request to your homepage and remembers the stylesheets and scripts that load.

To re-scan later — after activating a new plugin or theme, or if your site sits behind a full-page cache — use Re-scan the frontend on the settings page. It forgets the remembered stylesheets and scripts, clears the cached bundles, and crawls your front end again.

When an asset stops being used​

The remembered list is not append-only. Each stylesheet and script carries the date it was last seen on a page, refreshed every time a page that uses it is viewed, and anything unseen for 14 days drops out of the combined bundle.

That matters when a theme or plugin stops loading an asset without deleting it — a child theme that calls wp_dequeue_style() on its parent's stylesheet, for example. The file is still on disk, so "the file is gone" cannot be the test. Without the date the combiner would go on folding that CSS into every page, where it re-enters the cascade and can override the theme that deliberately dropped it. Use Re-scan the frontend if you would rather not wait out the 14 days.

Dropping an asset is deliberately the safe direction to get wrong: one left out of the bundle simply loads as its own request again, and the next page view puts it back.

Every setting, and where it is explained​

The General tab is long because each option is a different trade. This is the whole list:

SettingDefaultWhat it is for
Combine CSSOnMaster switch for merging stylesheets
Combine JavaScriptOnMaster switch for merging scripts
CSS combining scopeSite-wideOne shared bundle, or one per page
CSS deliveryLinked fileA cached file, or printed into the page
Remove unused CSSOffStrip rules nothing on the page can match
Never remove (safelist)EmptyProtect classes your own JavaScript adds
Inline the first screen's CSSOffSplit the stylesheet so the first paint never waits
Inline small leftover stylesheetsOnAbsorb the tiny files combining could not reach
Record which script each line came fromOffMap bundle line numbers back to real files
Drop admin-only stylesheetsOffStop shipping dashboard CSS to visitors
Move late CSS into the headOffStop elements jumping into place
Preload the hero imageOnTell the browser about the hero immediately
WebP quality80How hard the WebP copies are compressed
Image quality82How hard the theme's own crops are compressed
Generate missing image sizesOnFill in the sizes WordPress never made
Serve WebP imagesOnShow visitors WebP copies instead of JPG/PNG
Serve AVIF imagesOffOffer AVIF copies as well — another 28% under WebP
AVIF quality60How hard the AVIF copies are compressed
Browser cache for static filesOffCache images, fonts and plugin assets for a year
Load below-the-fold images earlyOffWarm lazy images before the reader scrolls
Instant navigationPrefetchFetch or render the next page before the click
How early to startModerateHow keen the browser should be
Never speculate cart, checkout or accountOnKeep shop pages out of speculation
Never speculate these pathsEmptyYour own exclusions
Only for logged-out visitorsOffServe un-combined assets to editors
Exclude URLsEmptySkip the combiner on particular pages
Stylesheets to combineAll checkedThe CSS tab's per-file list
Defer combined scriptOnStop scripts blocking the first paint
Minify combined scriptOnStrip comments and whitespace from the bundle
Scripts to combineFirst-partyThe JavaScript tab's per-file list

Two more behaviours have no setting at all and are always on: caching of the generated files and learning about stylesheets that arrive late.

The sections​

  • CSS — combining, scope, delivery, critical CSS, and the housekeeping options.
  • Removing unused CSS — the biggest win, and the one to test before relying on.
  • JavaScript — combining, deferring, minifying, and diagnosing a slow script.
  • Images — WebP, quality, missing sizes, the hero preload and lazy-image warming.
  • Instant navigation — prefetch and prerender the next page.
  • Caching and scope — browser caching, and limiting where any of this applies.

Typical workflow​

  1. Activate Asset Optimizer and open its settings (the asset lists populate from a homepage scan).
  2. On the CSS tab, leave the stylesheets you want merged checked; uncheck any to keep separate.
  3. On the JavaScript tab, the first-party scripts are pre-selected; tick any safe third-party scripts you also want combined, and consider Defer.
  4. Save. The combined, cached files are served on the front end; re-scan with Re-scan the frontend whenever your asset set changes.
  5. Once the page itself is fast, consider Instant navigation to take the wait out of the next click. Prefetch first; try prerender only after testing it.
It pairs with the clean output

Because the theme already compiles its design into one generated stylesheet and the page builder emits clean markup, Asset Optimizer has little to clean up — it mostly folds the remaining plugin and element stylesheets and scripts into one request each.

When a score will not move​

Worth knowing before you spend an afternoon on it: these options divide into ones that change what a synthetic audit measures and ones that change what a visitor experiences, and they are not the same set.

A page-speed score is dominated by what happens on the first screen of a single page. Options that help a second page view — caching, a shared bundle, instant navigation — are invisible to it by construction, because the test only ever loads one page. Options that spend bandwidth for the reader's benefit, like warming lazy images, can even make the number slightly worse while making the page nicer to read.

That is not a reason to skip them. It is a reason to decide what you are optimising for before you start, and to be suspicious of any advice — including a score — that only ever looks at one page.