remove_theme_support()WP 3.0.0

Allows themes to cancel previously registered new features.

The function should be called on the hook after_setup_theme or in the theme's functions.php file. That is, after the feature to be removed has been added by the function add_theme_support().

It is usually used for child themes to cancel a feature registered in the parent theme.

No Hooks.

Returns

true|false|null. true or false if the feature could not be canceled.

Usage

<?php remove_theme_support( $feature ); ?>
$feature(string) (required)

The name of the feature to be canceled. List of available:

Examples

0

#1 Remove support for post thumbnails:

add_action( 'after_setup_theme', 'wp_kama_after_setup_theme_action', 99 );

function wp_kama_after_setup_theme_action(){

	remove_theme_support( 'post-thumbnails' );
}
0

#2 Removing a Feature In a Child Theme

In some cases, a Parent Theme may have activated a feature that you do not want to have available in your Child Theme. For instance, if you are using a parent theme that has activated Featured Images for all Pages and Posts, but you’d like to remove the functionality of having Featured Images for Pages in your Child Theme, you could do something like this:

// in your Child Theme's functions.php    

// Use the after_setup_theme hook with a priority of 11 to load after the
// parent theme, which will fire on the default priority of 10
add_action( 'after_setup_theme', 'remove_featured_images_from_child_theme', 11 ); 

function remove_featured_images_from_child_theme() {

	// This will remove support for post thumbnails on ALL Post Types
	remove_theme_support( 'post-thumbnails' );

	// Add this line in to re-enable support for just Posts
	add_theme_support( 'post-thumbnails', array( 'post' ) );
}

Notes

Changelog

Since 3.0.0 Introduced.

remove_theme_support() code WP 7.0

function remove_theme_support( $feature ) {
	// Do not remove internal registrations that are not used directly by themes.
	if ( in_array( $feature, array( 'editor-style', 'widgets', 'menus' ), true ) ) {
		return false;
	}

	return _remove_theme_support( $feature );
}