WordPress performance & page weight

Stop shipping block-editor CSS to a theme that never uses it

Remove Block Assets strips the CSS and SVG WordPress injects for the block editor, one output at a time, so a classic theme or a theme with its own complete stylesheet stops receiving several kilobytes of unused styles on every single page load.

  • Four independent toggles, one per specific output.
  • Global Styles removal automatically skipped on block/FSE themes.
  • Each output dequeued at a late priority, after it's already enqueued.
  • An intentionally cautious, one-at-a-time workflow.
Per-Item TogglesRemove Block Assets
Remove Block AssetsRemoves the CSS and SVG WordPress injects for the block editor, item by item.
Block Library CSSRemoves wp-block-library and wp-block-library-theme.
Global StylesAutomatically skipped on block / FSE themes.
Classic Theme StylesRemoves classic-theme-styles since WP 6.1.
Duotone SVG FiltersSafe if the Duotone block feature is unused.
Four separate outputs, four separate switchesOnly what your theme doesn't use gets removed.
Active
Quick answer

What does Remove Block Assets do?

When the remove_global_styles module is active, TOWP_Performance registers its logic on after_setup_theme and checks four independent sub-options: gs_block_library dequeues the wp-block-library and wp-block-library-theme stylesheets, gs_global_styles removes the inline CSS WordPress generates from theme.json, gs_classic_theme dequeues the classic-theme-styles compatibility CSS added since WordPress 6.1, and gs_svg_filters removes the inline SVG WordPress injects for Duotone color filters. Since the Global Styles removal is automatically skipped on block or FSE themes, a site that depends on that inline CSS to render correctly keeps working exactly as before.

The "CSS for blocks you never use" problem

Every theme gets the same block styles, whether it uses blocks or not

Since WordPress ships this output on every front-end request by default, most themes carry it regardless of whether they actually need it.

A theme without blocks still receives block CSS

A classic theme, or one shipping its own complete stylesheet, still gets several kilobytes of block styles, layout rules and an inline SVG sprite on every front-end request.

What's safe to remove depends entirely on the theme

One theme might rely on part of this output to render correctly, while another never touches it at all, so a single blanket removal isn't a safe default for every site.

A dedicated WordPress solution

Four separate switches, one output each

The module lets each specific output get removed independently, so a site drops only what it genuinely doesn't use.

Four independent toggles

Block Library CSS, Global Styles, Classic Theme Styles and Duotone SVG Filters can each be switched off on their own, without affecting the others.

Global Styles protects block themes automatically

The removal is skipped automatically on block or FSE themes, since those themes rely on that inline CSS to actually render.

Built for a one-at-a-time workflow

Switch one item off, check the site, then move to the next, rather than committing to a single all-or-nothing removal.

Verified feature set

Four outputs, handled carefully

Every capability below is present in the supplied PHP class and its settings registration.

Global Styles, theme-aware

Skipped automatically on block and FSE themes

The inline CSS generated from theme.json only gets removed when wp_is_block_theme() confirms the active theme isn't one that depends on it.

wp_is_block_theme() checkgs_global_styles
Classic Theme Styles

The WP 6.1 compatibility CSS, dequeued

classic-theme-styles, the stylesheet WordPress has injected for classic themes since version 6.1, gets dequeued the same way as the block library CSS.

classic-theme-stylesgs_classic_theme
Duotone SVG Filters

Two related hooks removed together

Both the wp_body_open inline SVG output and the wp_footer Duotone asset hook get removed together, guarded by a class_exists() check.

WP_Duotonegs_svg_filters
Late dequeue priority

Runs after the styles are already enqueued

Each dequeue call runs at priority 100 on wp_enqueue_scripts, ensuring it executes after WordPress or the theme has already added the style.

Priority 100Runs after enqueue
Independently toggled, like its siblings

One setting among several performance tweaks

This module sits alongside Post Revisions, Heartbeat, and Autosave Interval in the same performance group, each gated by its own toggle.

Independent toggleShared performance group
Practical use cases

Where trimming block CSS helps most

The module supports any theme that doesn't genuinely need everything WordPress ships by default.

Classic themes that never touch the block editor's own styles

Drop the entire block library stylesheet on a theme built before blocks, or one that never relies on WordPress's own block styling.

Themes shipping their own complete stylesheet

Remove the redundant default output for a theme that already styles every block itself, without waiting on WordPress's version.

General front-end weight reduction on an established site

Trim a few kilobytes from every page load as part of a broader effort to keep front-end output lean.

Operational benefits

Lighter pages, without guessing

The module combines a real reduction in page weight with a design that protects against breaking a block theme by accident.

Less markup and CSS on every single pageEach toggle removes its specific output from every front-end request, not just a handful of pages.
No risk of breaking a block theme by accidentThe Global Styles removal checks the active theme first, so it can't silently strip out CSS an FSE theme actually needs.
A genuinely safe way to test what a theme actually needsTurning items off one at a time and checking the site makes it straightforward to find exactly what's safe to remove.
A real, if modest, reduction in page weightSeveral kilobytes of unused CSS and an inline SVG sprite add up across every page load on a busy site.
Performance behaviour

A handful of dequeues, nothing recurring

The verified implementation is a small, fixed set of conditional removals registered once.

A handful of dequeue calls, evaluated once

The entire module is a small set of conditional dequeue and remove_action calls registered once, at theme setup.

No effect on any item left switched off

An unchecked toggle changes nothing at all for that specific output; WordPress's default behavior continues exactly as before.

Removed output is removed entirely

A dequeued stylesheet or removed SVG output isn't just hidden with CSS; it simply never gets generated or sent for that page load.

Security implementation

Page weight only, nothing about access

The code changes what gets sent to the browser, never any capability or permission.

01

A performance setting, not an access control

This module only affects which CSS and SVG get sent to the browser; it has no effect on any capability, permission, or user account.

02

A theme-aware default prevents accidental breakage

The Global Styles check specifically protects against removing CSS a block theme actually depends on to render correctly.

03

Guarded against a missing class

The Duotone removal checks that WP_Duotone actually exists before touching its hooks, avoiding a fatal error on WordPress versions where it doesn't.

04

Configuration requires the same access as any other setting

Toggling any of these four items happens through the standard TheOneWP settings screen, available only to an administrator.

Verified compatibility

Built directly around WordPress's own block-asset hooks

The supplied code integrates through APIs present in WordPress core; this page makes no compatibility claim beyond the verified implementation.

Block library styles

wp-block-library and wp-block-library-theme handles

The native WordPress style handles registered for the default core-block CSS, dequeued directly by handle.

Native style handleswp_dequeue_style
Theme.json-generated CSS

wp_enqueue_global_styles action

The native WordPress action responsible for outputting the inline CSS generated from a theme's theme.json file.

wp_is_block_theme()wp_enqueue_global_styles
Duotone color filters

WP_Duotone class hooks

The native WordPress class responsible for Duotone's inline SVG filter output, hooked on wp_body_open and wp_footer.

class_exists() guardWP_Duotone
Solution comparison

TheOneWP versus common alternatives

Compare the verified implementation with a typical all-or-nothing removal snippet.

CapabilityTheOneWP Remove Block AssetsOther common solutions
Granularity Four independent toggles, one per specific outputOften a single all-or-nothing switch for every block-related asset
Block theme safety Global Styles removal automatically skipped on FSE themesA blanket removal can silently break a block theme's own styling
Duotone coverage Both related hooks removed together, class-guardedFrequently overlooked entirely, or removed without checking the class exists
Dequeue timing Runs at a late priority, after the style is already enqueuedAn earlier hook can miss a style enqueued later by the theme
Administration Four labeled toggles with plain-language descriptionsUsually a single technical option with no per-item explanation
Recommended workflow

Test the theme, one toggle at a time

Confirm each specific removal is safe for the active theme before moving to the next.

01

Enable Remove Block Assets

Activate the module from the TheOneWP System settings tab.

02

Switch on one item

Start with a single toggle, such as Block Library CSS, rather than enabling all four at once.

03

Check the site

Look over the front end for anything that looks off before deciding to keep the change.

04

Repeat for the next item

Move on to the next toggle only once the previous one has been confirmed safe for the theme.

Best practices

Move carefully, revisit after any theme change

Each toggle's safety depends entirely on the active theme, so caution and periodic rechecking matter here.

01

Test on a staging copy before an established site

Confirm each toggle's effect somewhere changes are easy to undo before applying it to a live, actively visited site.

02

Expect Global Styles to stay unavailable on a block theme

If the site runs a block or FSE theme, that specific toggle is automatically skipped rather than applied.

03

Revisit after a theme change

A new theme may depend on styles the old one didn't, so previously safe toggles are worth re-checking after switching themes.

04

Leave Duotone SVG Filters on only if the feature is actually unused

Removing it is safe specifically for sites that don't use WordPress's Duotone block feature anywhere.

Common mistakes

Avoid rushing the one-at-a-time process

A couple of shortcuts are worth resisting when enabling these toggles.

Enabling all four toggles at once on a live site

The module is built for a one-at-a-time workflow; switching everything on together makes it harder to trace which change caused an issue.

Assuming Global Styles removal always applies

On a block or FSE theme, this specific toggle is automatically skipped, regardless of whether it's switched on in the settings.

Removing Duotone filters on a site that still uses the feature

A Duotone-styled image will lose its color filter if the feature is still in use somewhere on the site.

Frequently asked questions

Remove Block Assets FAQ

These answers come directly from the verified class and its settings registration.

What does Remove Block Assets do?

It removes specific CSS and SVG outputs WordPress adds for the block editor, with each output controlled by its own independent toggle.

Will this break my theme?

The Global Styles toggle is automatically skipped on block or FSE themes to avoid breaking them; the other toggles should be tested one at a time to confirm they're safe for a given theme.

What's the difference between Block Library CSS and Global Styles?

Block Library CSS is the default styling for core blocks like buttons and columns; Global Styles is the inline CSS generated specifically from the theme's theme.json file.

What does Classic Theme Styles remove?

It removes classic-theme-styles, a compatibility stylesheet WordPress has added for classic themes since version 6.1.

Is it safe to remove Duotone SVG Filters?

It's safe on a site that doesn't use the Duotone block feature; removing it while the feature is in use will affect any image relying on a Duotone color filter.

Can I enable just one of the four toggles?

Yes. Each toggle is completely independent of the others.

Does this affect the block editor itself while writing content?

No. These toggles remove front-end output; they don't affect the editing experience in wp-admin.

Will this speed up my site?

It reduces the CSS and SVG sent on every front-end request by a modest but real amount, depending on which toggles are enabled.

What happens if I enable a toggle and it breaks something?

Turning that specific toggle back off restores WordPress's default output immediately.

Who can enable these toggles?

Only an administrator with access to the TheOneWP settings screen.

Stop sending block CSS to a theme that doesn't need it.Remove exactly what your theme doesn't use.

Use Remove Block Assets to drop block library styles, global styles, classic theme styles, or Duotone filters, one at a time, with block themes protected automatically.