-3

I would like to remove the default sidebar from my template, it is not needed and I do not want to confuse the user that will be using the admin panel. I have created my own sidebars that are a bit more descriptive to hold content throughout the site.

2 Answers 2

1

If you mean the default WordPress Widgets, you would add this to the functions.php file:

<?php
    // unregister all default WP Widgets
function unregister_default_wp_widgets() {
    unregister_widget('WP_Widget_Pages');
    unregister_widget('WP_Widget_Calendar');
    unregister_widget('WP_Widget_Archives');
    unregister_widget('WP_Widget_Links');
    unregister_widget('WP_Widget_Meta');
    unregister_widget('WP_Widget_Search');
    unregister_widget('WP_Widget_Text');
    unregister_widget('WP_Widget_Categories');
    unregister_widget('WP_Widget_Recent_Posts');
    unregister_widget('WP_Widget_Recent_Comments');
    unregister_widget('WP_Widget_RSS');
    unregister_widget('WP_Widget_Tag_Cloud');
    unregister_widget('WP_Nav_Menu_Widget');
}
add_action('widgets_init', 'unregister_default_wp_widgets', 1);
?>

EDIT:

register_sidebar(array('name'=>'sidebar2',
'before_widget' => '<ul><li>',
'after_widget' => "</li></ul>",
'before_title' => '<h2 class="widgettitle">',
'after_title' => "</h2>"
));

Where it says Sidebar2, is where you can add your title for the sidebar position. Just be sure it is relative to the actual position.

4
  • I am looking for the actual container for the widgets and not the widgets themself. Thanks though, I am currently using this in my functions.php file as well.
    – jnolte
    Sep 10, 2011 at 20:42
  • I'm not sure what you are talking about. What do you mean when you say I do not want to confuse the user that will be using the admin panel. If you are talking about the title, you change it by adjusting the functions.php. See my edit above. Sep 11, 2011 at 1:23
  • There is a default sidebar named "sidebar" when you go to appearance -> widgets. I would like to remove it.
    – jnolte
    Sep 11, 2011 at 17:06
  • You'll need to look in your themes functions.php file to remove any default widget that is being added from the theme. It may also be in another file depending on the theme. If your theme is using additional files for such functions, it should be getting added via the functions.php file. Look for something similar to the "Edit" above. I can't really help much more than that without knowing your theme or seeing the code. Sep 11, 2011 at 20:32
1

if you using twentyeleven theme look for

add_action( 'widgets_init', 'twentyeleven_widgets_init' );

in functions.php (somewhere @ line 422) and comment it. This will disable the default widget holder from admin area.

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.