I am creating a child theme using twentyten as my base. I am looking for a way to remove the features of adding custom header and background without touching functions.php file in the parent theme.

no luck with this :(

function my_child_theme_setup() {

add_action( 'after_setup_theme', 'my_child_theme_setup' );
  • I don't know what changed inside WP core. But your solution works perfectly for me. I am using Twenty Twenty as a child theme with white background color which I don't want to be touched inside the customizer.
    – Juergen
    Jul 21 '20 at 13:20

Both the header and background image features setup some globals in order to work, unsetting those globals seems to have some effect, and at the least removes them from the administration side.

add_action('after_setup_theme', 'remove_theme_features', 11 );

function remove_theme_features() {
    $GLOBALS['custom_background']   = 'kill_theme_features';
    $GLOBALS['custom_image_header'] = 'kill_theme_features';
class kill_theme_features {
    function init() { return false; }

There's expectations for a class name to be provided as a callback for both of these features, and both expect the given class to have an init method. The solution was to create a dummy class that does nothing and update the globals, which effectively kills off the theme background and header pages in the admin area.

Hope that helps..

  • only this worked so far +1
    – Atif
    Feb 17 '11 at 8:52
  • I tried all the suggestions posted myself(i use a child theme to), and none of them worked for me, so i was determined to find a method that worked. It's odd really, the method Rarst posted should(in theory at least) do exactly what you're asking, so i can only assume it's bugged(or that we're all doing it wrong, lol).
    – t31os
    Feb 17 '11 at 11:38

Child theme is processed before parent theme. So your function is getting hooked earlier and fires before twentyten_setup().


add_action( 'after_setup_theme', 'my_child_theme_setup', 11 );

Alternatively you can copy twentyten_setup() to your child theme and modify, since it is declared conditionally on ! function_exists( 'twentyten_setup' )


remove_theme_support should do the trick.


It seems custom headers & custom backgrounds have their own functions for this: Custom Headers . I assume the same type of function should be for custom backgrounds, but I can't find it in the reference, searching for it in the files.

EDIT 2 -

The remove_custom_image_header function is available only from 3.1, according to the codex. I would suggest Rarst's suggestion right now.

  • edit, still no luck
    – Atif
    Feb 16 '11 at 10:17
  • 1
    @atif089 edited, maybe this will help.
    – Cronco
    Feb 16 '11 at 10:58


function my_child_theme_setup() {
    global $_wp_theme_features;
    unset( $_wp_theme_features['custom-background'] );
    unset( $_wp_theme_features['custom-header'] );


add_action( 'after_setup_theme', 'my_child_theme_setup' );

Hope this helps


From a brief search through core, i couldn't verify the existance of remove_custom_image_header() *). I only found add_custom_image_header() that uses add_theme_support(), so this should work.

If it doesn't you can go one step closer to core and use the Theme Modifications API. Strange as it is: The API only has a function that removes all modifications: remove_theme_mods() that takes no additional parameters.

After thinking about it, your best chance is to filter it: add_filter( "theme_mod_$name", 'your_callback_fn' );, but i'm not completely sure if it removes it from admin UI (10% chance it does). So maybe you'll have to unset that menu entries via another function.

Anyway: Take a look into ~/wp-includes/theme.php ... that's the "twenty ten" core support file (that won't be used by other themes i guess).

*) This is really strange...


remove_custom_image_header() now is available with WP 3.1+.

And a short edit of @t310s answer:

function remove_theme_features() 
    $GLOBALS['custom_background']   = '__return_false';
    $GLOBALS['custom_image_header'] = '__return_false';
add_action( 'after_setup_theme', 'remove_theme_features', 20 );

It's just shorter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.