Remove support for a WordPress theme feature at runtime

Updated on September 12, 2025

There are cases where you need to change the features supported by a theme. For example, you may be creating a child theme with different capabilities, or you may need to disable a feature to remove conflicts. Either way, you can remove theme support with the following technique.

add_action( 'after_setup_theme', function() {
    remove_theme_support( 'title-tag' );
}, 20 );

This example removes title-tag support, but you can change to the feature of your choice. See Theme Features « WordPress Codex for a list of theme identifiers.

How it works

This snippet adds a handler for the after_setup_theme hook. This hook is called on each page after the theme is initialized. Once the theme has been initialized, it calls remove_theme_support to deregister support for title-tag. This approach is commonly used by child themes to override the configuration of the parent theme.

How to use the snippet

If you need this code to fix a conflict on your website, then use a code plugin such as FluentSnippets. A code plugin lets you define small snippets of code without changing your theme or WordPress files. You should set this snippet to execute on all pages.

Reference

See also

License

Licensed under CC BY 4.0

You are free to share and adapt this content for any purpose as long as you give appropriate credit in a reasonable manner.

No affiliate links

We do not participate in affiliate marketing, and we are not paid to mention products.

Leave a Reply

Your email address will not be published. Required fields are marked *