Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I like to use a child-theme.

The parent functions.php

function starkers_widgets_init() {
// Area 1, located at the top of the sidebar.
register_sidebar( array(
    'name' => __( 'Primary Widget Area', 'starkers' ),
    'id' => 'primary-widget-area',
    'description' => __( 'The primary widget area', 'starkers' ),
    'before_widget' => '<li>',
    'after_widget' => '</li>',
    'before_title' => '<h3>',
    'after_title' => '</h3>',
) );

// Area 2 ...

My child-theme functions.php

function xtreme_unregister_sidebar() {
    add_action( 'childtheme_sidebars', 'xtreme_unregister_sidebar' );

But doesn´t work for.

share|improve this question

2 Answers 2

up vote -1 down vote accepted

Check the code bellow, I think that should work.

add_action( ‘after_setup_theme’, ‘remove_default_sidebars’, 11 );
function remove_default_sidebars(){
remove_action( ‘widgets_init’, ‘starkers_widgets_init’ );
share|improve this answer
WOW, works too, thanks a lot. –  ogni Apr 22 '12 at 17:21
I just edit the quotes // Remove all widgets from Starkers-Theme add_action( 'after_setup_theme', 'remove_default_sidebars', 11 ); function remove_default_sidebars(){ remove_action( 'widgets_init', 'starkers_widgets_init' ); } –  ogni Apr 22 '12 at 17:22

The Title of this post is for unregistering widgets not really sidebars, though I am glad the user got what they were looking for. For those searching for how to unregister widgets using a child-theme where the widget was registered in the parent theme, you can do that with this:

Assuming the Parent Theme's Widget is registered at the widgets_init hook, all you need to do is wrap your unregister_widget() call inside of a function, hook that function into widgets_init, and give your hook a higher priority number than the Parent Theme's widgets_init-hooked function.

Assuming the Parent Theme hooks into widgets_init without giving a priority number, the function will default to 10. So, just give your hook call a priority of 11 or greater.

so something like this:

add_action( 'widgets_init', 'remove_theme_widgets', 11 );

function remove_theme_widgets() {


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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