Using WordPress ‘remove_theme_support()’ PHP function

The remove_theme_support() WordPress PHP function allows a theme to de-register its support for a certain feature. It is typically used in a child theme’s functions.php file to override support from the parent theme.

Usage

remove_theme_support( $feature );

Example

// Remove support for custom background
remove_theme_support( 'custom-background' );

Parameters

  • $feature (string) – The feature being removed. See add_theme_support() for the list of possible values.

More information

See WordPress Developer Resources: remove_theme_support()

Examples

Disable support for custom header

Disable the custom header feature in your child theme:

add_action( 'after_setup_theme', 'my_child_theme_remove_custom_header', 11 );
function my_child_theme_remove_custom_header() {
    remove_theme_support( 'custom-header' );
}

Remove support for post formats

Remove support for post formats in your child theme:

add_action( 'after_setup_theme', 'my_child_theme_remove_post_formats', 11 );
function my_child_theme_remove_post_formats() {
    remove_theme_support( 'post-formats' );
}

Disable custom logo support

Disable custom logo support in your child theme:

add_action( 'after_setup_theme', 'my_child_theme_remove_custom_logo', 11 );
function my_child_theme_remove_custom_logo() {
    remove_theme_support( 'custom-logo' );
}

Remove support for responsive embeds

Remove support for responsive embeds in your child theme:

add_action( 'after_setup_theme', 'my_child_theme_remove_responsive_embeds', 11 );
function my_child_theme_remove_responsive_embeds() {
    remove_theme_support( 'responsive-embeds' );
}

Disable support for custom background

Disable support for custom background in your child theme:

add_action( 'after_setup_theme', 'my_child_theme_remove_custom_background', 11 );
function my_child_theme_remove_custom_background() {
    remove_theme_support( 'custom-background' );
}