remove_theme_support() WordPress Function

The remove_theme_support() function allows you to remove theme support for a given feature from your theme. This is useful if you want to disable a feature that is no longer needed or supported by your theme. For example, if your theme no longer supports post thumbnails, you can use this function to remove support for them.

remove_theme_support( string $feature ) #

Allows a theme to de-register its support of a certain feature


Description

Should be called in the theme’s functions.php file. Generally would be used for child themes to override support from the parent theme.

Top ↑

See also


Top ↑

Parameters

$feature

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


Top ↑

Return

(bool|void) Whether feature was removed.


Top ↑

Source

File: wp-includes/theme.php

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 );
}


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More