WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to remove Main Sidebar, First and Second Front Page Widget areas in my child theme. Basically I don't want them to be shown up in Admin Panel.

I've placed that code into my function.php file. It's seems to not work:

function remove_some_widgets(){

    unregister_sidebar( 'Main Sidebar' );
    unregister_sidebar( 'First Front Page Widget Area' );
    unregister_sidebar( 'Secon Front Page Widget Area' );
add_action( 'widgets_init', 'remove_some_widgets', 11 );

I've got it from WordPress Codex but I think that was developed for Twenty Ten theme. Anyone knows the right code for Twenty Twelve parent theme. ?

Thanks for answers.

share|improve this question
up vote 1 down vote accepted

The unregister_sidebar takes the ID, not the name:

<?php unregister_sidebar( $id ); ?> 

You'll need to do it like this:

function remove_some_widgets(){
    unregister_sidebar( 'sidebar-1' );
    unregister_sidebar( 'sidebar-2' );
    unregister_sidebar( 'sidebar-3' );
add_action( 'widgets_init', 'remove_some_widgets', 11 );
share|improve this answer
That works perfectly. Thanks a lot! – Andrewski Jun 1 '13 at 13:58

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.