Title: _remove_theme_support
Published: April 25, 2014
Last modified: August 20, 2026

---

# _remove_theme_support( string $feature ): bool

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/_remove_theme_support/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/_remove_theme_support/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/_remove_theme_support/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/_remove_theme_support/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/_remove_theme_support/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/_remove_theme_support/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Do not use. Removes theme support internally without knowledge of those not used
by themes directly.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/_remove_theme_support/?output_format=md#parameters)󠁿

 `$feature`stringrequired

The feature being removed. See [add_theme_support()](https://developer.wordpress.org/reference/functions/add_theme_support/)
for the list of possible values.

More Arguments from add_theme_support( … $feature )

The feature being added. Likely core values include:

 * `'admin-bar'`
 * `'align-wide'`
 * `'appearance-tools'`
 * `'automatic-feed-links'`
 * `'block-templates'`
 * `'block-template-parts'`
 * `'border'`
 * `'core-block-patterns'`
 * `'custom-background'`
 * `'custom-header'`
 * `'custom-line-height'`
 * `'custom-logo'`
 * `'customize-selective-refresh-widgets'`
 * `'custom-spacing'`
 * `'custom-units'`
 * `'dark-editor-style'`
 * `'disable-custom-colors'`
 * `'disable-custom-font-sizes'`
 * `'disable-custom-gradients'`
 * `'disable-layout-styles'`
 * `'editor-color-palette'`
 * `'editor-gradient-presets'`
 * `'editor-font-sizes'`
 * `'editor-spacing-sizes'`
 * `'editor-styles'`
 * `'featured-content'`
 * `'html5'`
 * `'link-color'`
 * `'menus'`
 * `'post-formats'`
 * `'post-thumbnails'`
 * `'responsive-embeds'`
 * `'starter-content'`
 * `'title-tag'`
 * `'widgets'`
 * `'widgets-block-editor'`
 * `'wp-block-styles'`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/_remove_theme_support/?output_format=md#return)󠁿

 bool True if support was removed, false if the feature was not registered.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/_remove_theme_support/?output_format=md#source)󠁿

    ```php
    function _remove_theme_support( $feature ) {
    	global $_wp_theme_features;

    	switch ( $feature ) {
    		case 'custom-header-uploads':
    			if ( ! isset( $_wp_theme_features['custom-header'] ) ) {
    				return false;
    			}
    			add_theme_support( 'custom-header', array( 'uploads' => false ) );
    			return true; // Do not continue - custom-header-uploads no longer exists.
    	}

    	if ( ! isset( $_wp_theme_features[ $feature ] ) ) {
    		return false;
    	}

    	switch ( $feature ) {
    		case 'custom-header':
    			if ( ! did_action( 'wp_loaded' ) ) {
    				break;
    			}
    			$support = get_theme_support( 'custom-header' );
    			if ( isset( $support[0]['wp-head-callback'] ) ) {
    				remove_action( 'wp_head', $support[0]['wp-head-callback'] );
    			}
    			if ( isset( $GLOBALS['custom_image_header'] ) ) {
    				remove_action( 'admin_menu', array( $GLOBALS['custom_image_header'], 'init' ) );
    				unset( $GLOBALS['custom_image_header'] );
    			}
    			break;

    		case 'custom-background':
    			if ( ! did_action( 'wp_loaded' ) ) {
    				break;
    			}
    			$support = get_theme_support( 'custom-background' );
    			if ( isset( $support[0]['wp-head-callback'] ) ) {
    				remove_action( 'wp_head', $support[0]['wp-head-callback'] );
    			}
    			remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) );
    			unset( $GLOBALS['custom_background'] );
    			break;
    	}

    	unset( $_wp_theme_features[ $feature ] );

    	return true;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/theme.php#L3091)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/theme.php#L3091-L3138)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/_remove_theme_support/?output_format=md#related)󠁿

| Uses | Description | 
| [add_theme_support()](https://developer.wordpress.org/reference/functions/add_theme_support/)`wp-includes/theme.php` |

Registers theme support for a given feature.

  | 
| [get_theme_support()](https://developer.wordpress.org/reference/functions/get_theme_support/)`wp-includes/theme.php` |

Gets the theme support arguments passed when registering that support.

  | 
| [remove_action()](https://developer.wordpress.org/reference/functions/remove_action/)`wp-includes/plugin.php` |

Removes a callback function from an action hook.

  | 
| [did_action()](https://developer.wordpress.org/reference/functions/did_action/)`wp-includes/plugin.php` |

Retrieves the number of times an action has been fired during the current request.

  |

| Used by | Description | 
| [remove_editor_styles()](https://developer.wordpress.org/reference/functions/remove_editor_styles/)`wp-includes/theme.php` |

Removes all visual editor stylesheets.

  | 
| [remove_theme_support()](https://developer.wordpress.org/reference/functions/remove_theme_support/)`wp-includes/theme.php` |

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

  | 
| [unregister_nav_menu()](https://developer.wordpress.org/reference/functions/unregister_nav_menu/)`wp-includes/nav-menu.php` |

Unregisters a navigation menu location for a theme.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_remove_theme_support/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2F_remove_theme_support%2F)
before being able to contribute a note or feedback.