Technote

Performance optimization Advanced

Series Making a theme feel like your brand Part 8 of 8

Auditing a theme: what it loads versus what it uses

Themes routinely ship assets for features you never use. Once you have the list, what can safely go and what cannot becomes obvious.

This is the final part. You have built a child theme, decided where styles and templates belong, and set an order for taking updates safely. The last thing to look at is what this theme actually sends to visitors.

This is a designer’s job. The number of webfonts, the icon approach, whether there is a slider at all — these are design decisions, and they are what produce the asset list.

1. Build the list — do not guess

Open the network panel in developer tools, clear the cache and reload. You get a list of CSS and JS files, and what matters is the filename and where it came from: the path itself tells you whether the theme or a plugin requested it.

The coverage tool in the same devtools reports how much of the downloaded CSS went unused. Do not read that figure directly as waste — those rules may be used on other pages. It is good for finding candidates: files that are barely used on any screen.

Four steps — skip the last one and it was not an audit

2. Remove things conditionally

Unused assets can be dequeued. The important part is doing it conditionally rather than globally.

add_action( 'wp_enqueue_scripts', function () {
    if ( ! is_front_page() ) {
        wp_dequeue_style( 'acme-slider' );
        wp_dequeue_script( 'acme-slider' );
    }
}, 100 );

The high priority number is there because you can only dequeue after something has been enqueued. If the theme registers late, you have to go later still. When a dequeue appears to do nothing, this ordering is usually why.

Two cautions. First, some scripts are dependencies of other scripts. Remove one and whatever depended on it quietly stops working — the page looks fine but the slider or the menu no longer moves. Second, the admin and the editor load their own assets. A decision made by looking only at the front end can break the editing screen, so open a post editor once after any change.

3. It comes back to design decisions

There is a ceiling on what dequeuing can win. The substantial improvements come from what you chose to use in the first place.

Assets decided at design time — code cannot claw all of this back

Icon fonts come up constantly. If you use six icons and download a font containing hundreds, six inline SVGs are always lighter and give you far better control over colour.

4. Measure again — and report honestly

An audit ends by measuring again, and there is a rule to keep. Same URL, same conditions, same time of day, several runs, take the median. A single reading is a snapshot of that moment’s network; presented as a result, it gets contradicted by the next measurement.

Then write down what did not improve. Recording the assets you could not remove and why — a dependency of something else, needed by the editor — means the next person doing this work does not re-verify what you already checked.

Closing the series

At this point the structure holds: the parent theme keeps receiving updates, your decisions sit together inside the child theme, and there is a list of everything you overrode. WordPress has supported this arrangement from the beginning — the trouble was never the tool, it was not using the arrangement.

Follow-up reading from a performance angle lives in the Performance archive. If you would rather hand over the asset audit, the version upgrades and the security review as one job, that is the scope of our optimization program, and the order the work actually runs in is published on our process page.

More on this topic

All technotes

Performance optimization Practical

Who pays for the milliseconds a tag adds?

A tracking script does not stop at downloading. While it is parsed and executed the main thread is busy, and a busy page ignores fingers. That cost is…

Marketers 5 min read

Performance optimization Practical

The object cache: what Redis actually removes

Repeated identical lookups disappear. One slow query does not. Miss that distinction and you will wire up Redis and then ask why nothing got faster.

Developers 7 min read

Performance optimization Practical

This is how a landing page gets heavy

Nobody decides to make a landing page heavy. It accumulates: one addition per campaign, and nothing ever removed when the campaign ends.

Marketers 6 min read

₩270,000 · Join the program