Moritz Reitz
← Back to blog

Removing plugin stylesheets in WordPress

How to remove plugin and theme stylesheets in WordPress using wp_dequeue_style and wp_deregister_style — including handle lookup, priority, conditional removal, and edge cases.

7 July 2026 · Moritz Reitz

One of the first things I do on any WordPress site I build is go through the loaded stylesheets and cut the ones I don't need. Unused CSS is dead weight — it adds page weight, can interfere with your own styles, and on a site using a page builder most of the default WordPress and plugin styles are completely redundant.

Here's how I approach it.

Finding What's Actually Loading

Before you can remove anything you need to know what's there. The easiest way is to open your browser dev tools, go to the Network tab, filter by CSS, and reload the page. Every stylesheet will show up with its URL.

But to get the WordPress handle (the internal name you need to dequeue), you either need to read the id attribute on the <link> tag in the page source — WordPress appends -css to the handle, so id="wp-block-library-css" means the handle is wp-block-library — or you can temporarily drop this into a theme file to dump the full list:

add_action('wp_print_styles', function() {
    global $wp_styles;
    var_dump(array_keys($wp_styles->queue));
    die();
});

Remove that immediately after, obviously.

The Basic Pattern

Once you have a handle, deregistering it looks like this (see the wp_dequeue_style() documentation and wp_deregister_style() documentation for full details):

function disable_stylesheets() {
    wp_dequeue_style('handle-name');
    wp_deregister_style('handle-name');
}
add_action('wp_enqueue_scripts', 'disable_stylesheets', 100);

A few things to note here:

Dequeue and deregister. Dequeuing alone removes it from the output queue, but the style is still registered. Some plugins check wp_style_is('handle', 'registered') and re-enqueue if they find it registered. Deregistering prevents that.

Priority 100. The default priority is 10. Plugins and themes enqueue their styles somewhere around priority 10 as well, so running at 100 means you're always after them. If something still loads despite being in your list, bump the priority higher.

Common Ones I Usually Remove

function disable_stylesheets() {
    // WordPress core block styles — not needed outside the editor on builder sites
    wp_dequeue_style('wp-block-library');
    wp_deregister_style('wp-block-library');

    // Bricks-specific — colour palette and Gutenberg editor styles
    // not needed on the frontend
    wp_dequeue_style('bricks-color-palettes');
    wp_deregister_style('bricks-color-palettes');
    wp_dequeue_style('bricks-frontend-gutenberg');
    wp_deregister_style('bricks-frontend-gutenberg');
}
add_action('wp_enqueue_scripts', 'disable_stylesheets', 100);

Your list will differ depending on what plugins you're running. Form plugins, SEO plugins, and sliders are the worst offenders for loading CSS everywhere regardless of whether their shortcode or block is on the page.

Conditional Removal

Sometimes you don't want to strip a stylesheet globally — only on certain pages. You can wrap the dequeue in any standard WordPress conditional:

function disable_stylesheets() {
    // Only strip the contact form styles when not on the contact page
    if (!is_page('contact')) {
        wp_dequeue_style('some-form-plugin-styles');
        wp_deregister_style('some-form-plugin-styles');
    }
}
add_action('wp_enqueue_scripts', 'disable_stylesheets', 100);

This is useful for plugins that let you disable their CSS globally but then you still need it in one or two places.

When Dequeue Doesn't Work

If a style keeps showing up despite being in your dequeue list, there are a few possible reasons:

The handle name is wrong. Double-check by inspecting the id attribute on the <link> tag and stripping the -css suffix.

Your priority is too low. Something is re-enqueuing the style after priority 100. Bump to PHP_INT_MAX to rule this out, then identify what's re-adding it.

It's being added as an inline style, not a stylesheet. Some plugins output <style> blocks directly rather than going through the WordPress style queue. wp_dequeue_style won't touch those — you'd need to use output buffering or a different hook to strip them.

The style has a special enqueue mechanism. The WordPress global-styles stylesheet is a good example — it's hooked to both wp_enqueue_scripts and wp_footer, so a standard dequeue only catches one of them. Some plugin stylesheets work similarly. In those cases you need to remove_action on the function that does the enqueueing rather than dequeuing after the fact.

Putting It in a Plugin vs. Your Theme

I keep general stylesheet cleanup in my child theme's functions.php since it's tightly coupled to how I'm building the site. But if you're removing stylesheets from a specific third-party plugin, consider putting that logic in a small custom plugin instead. That way if you change themes, your optimisations don't disappear.

I do this for Fluent Forms specifically — the CSS adjustments are in a dedicated fluentforms-customisations plugin rather than the theme, so they survive a theme switch.

The Login Page

Worth noting: wp_enqueue_scripts does not fire on the login page. If you're loading something there you don't want, use login_enqueue_scripts with the same dequeue pattern.

A Note on Caching

If you're running a caching plugin and the stylesheet keeps showing up after your changes, clear the cache before assuming your code isn't working. Full page caches will serve the old HTML complete with the old <link> tags regardless of what your PHP is doing. WordPress's performance optimization guide covers caching behaviour and other frontend improvements in more detail.

Work with me

Found this helpful?

Get in touch if you need help with your website, SEO, or paid advertising — I offer a free initial consultation.