How to Disable Theme Features Safely (Supports, Widgets, Block Styles)

December 26, 2025
How to Disable Theme Features Safely (Supports, Widgets, Block Styles)

As WordPress evolves, themes often inherit features they don’t actually need:
block editor styles, widgets, emoji scripts, embeds, or even theme supports added “just in case”.
Left unmanaged, these features add unused CSS/JS, complicate maintenance, and sometimes break layouts.

This article explains how to disable theme features safely using code,
focusing on three common areas:

  • Theme supports (add_theme_support)
  • Widgets and widget-related assets
  • Block styles and block-related front-end CSS

The goal is not to fight WordPress core, but to intentionally opt out of features you don’t use
while staying update-safe and future-proof.

Guiding Principle: Disable Only What You Truly Don’t Use

Before disabling anything, confirm:

  • Your theme does not rely on the feature
  • No plugin depends on it
  • You understand what replaces it (custom CSS, custom templates, etc.)

Disabling features blindly can cause subtle breakage.
The following patterns are safe when applied intentionally.

1) Disable Unused Theme Supports

Theme supports enable WordPress features such as block styles, widgets, thumbnails, or HTML5 markup.
If your theme does not use them, remove them explicitly.

Remove Block Editor Front-End Styles

If you are using a classic theme with handcrafted CSS, you often don’t need block styles on the front end.

<?php
add_action( 'after_setup_theme', function () {
  remove_theme_support( 'wp-block-styles' );
} );

This prevents WordPress from injecting default block styling assumptions into your layout.

Disable Wide / Full Alignment Support

If your layout does not support wide or full-width blocks:

<?php
add_action( 'after_setup_theme', function () {
  remove_theme_support( 'align-wide' );
} );

This avoids editor options that do nothing visually.

Disable Editor Color / Font Presets

If you define your own design system in CSS and don’t want editor presets:

<?php
add_action( 'after_setup_theme', function () {
  remove_theme_support( 'editor-color-palette' );
  remove_theme_support( 'editor-font-sizes' );
} );

2) Disable Widgets (and Widget Assets)

If your theme does not use widgets at all, disabling them reduces UI clutter and unnecessary assets.

Disable the Widgets Screen

<?php
add_action( 'admin_init', function () {
  remove_menu_page( 'widgets.php' );
} );

This hides the Widgets menu from the admin.

Disable Widgets Functionality Entirely

If you truly don’t use widgets anywhere:

<?php
add_action( 'after_setup_theme', function () {
  remove_theme_support( 'widgets' );
} );

Note: This is safe only if your theme does not register sidebars or rely on widgets for layout.

Prevent Widget Block Assets on the Front End

Block-based widgets can enqueue CSS even if you don’t use them.
You can remove these assets conditionally.

<?php
add_action( 'wp_enqueue_scripts', function () {
  wp_dequeue_style( 'wp-block-widgets' );
}, 100 );

3) Disable Block Styles Safely

Block styles are one of the biggest sources of unused CSS in classic themes.
Disabling them should be done at both the theme-support and asset levels.

Remove Core Block CSS

<?php
add_action( 'wp_enqueue_scripts', function () {
  wp_dequeue_style( 'wp-block-library' );
  wp_dequeue_style( 'wp-block-library-theme' );
}, 100 );

This removes the main Gutenberg front-end styles.

Disable Inline Global Styles (theme.json)

If your theme does not use theme.json:

<?php
add_action( 'wp_enqueue_scripts', function () {
  wp_dequeue_style( 'global-styles' );
}, 100 );

This prevents large inline CSS from being output in the page head.

4) Disable Editor Features Without Breaking the Editor

A common mistake is disabling block assets globally, including in the admin.
Never do this.

Always scope removals to the front end:

<?php
add_action( 'wp_enqueue_scripts', function () {
  if ( is_admin() ) {
    return;
  }

  // Front-end only dequeues here
}, 100 );

The editor depends on block styles and scripts to function correctly.

5) Disable Emoji and Embed Features (Related Cleanup)

While not strictly “theme supports”, these are commonly disabled alongside theme cleanup.

Disable Emojis

<?php
add_action( 'init', function () {
  remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
  remove_action( 'wp_print_styles', 'print_emoji_styles' );
} );

Disable Embeds

<?php
add_action( 'init', function () {
  remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
  remove_action( 'wp_head', 'wp_oembed_add_host_js' );
} );

6) Conditional Disabling (Safer for Mixed Sites)

If some templates use blocks and others don’t, disable features conditionally.

<?php
add_action( 'wp_enqueue_scripts', function () {
  if ( is_page_template( 'templates/landing.php' ) ) {
    wp_dequeue_style( 'wp-block-library' );
    wp_dequeue_style( 'global-styles' );
  }
}, 100 );

This avoids breaking content that still relies on blocks.

Common Mistakes to Avoid

  • Removing block assets in the admin area
  • Disabling widgets while the theme still registers sidebars
  • Assuming block styles are unused without checking templates
  • Removing supports added by plugins without testing

How to Verify Your Changes

  • Front end: Chrome DevTools → Network → CSS/JS
  • Coverage tab → confirm block CSS is not loaded
  • Editor: ensure block editor still functions correctly
  • Pages using legacy content and new blocks

Summary

  • Remove unused theme supports with remove_theme_support
  • Disable widgets only if your theme does not rely on them
  • Dequeue block styles and global styles on the front end
  • Never break the editor by disabling admin assets
  • Prefer conditional removal on mixed-content sites

Disabling unused theme features keeps your WordPress site lean, predictable, and easier to maintain.
When done carefully, it improves performance without sacrificing editor usability or future updates.

Avatar

Written by

satoshi

I’ve been building and customizing WordPress themes for over 10 years. In my free time, you’ll probably find me enjoying a good football match.