Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Removing default sidebars


Boone Gorges
Keymaster

@boonebgorges

unregister_sidebar() works but it is weird and finicky.

WP’s internal documentation says that unregister_sidebar() takes the ID of the sidebar as an argument, which I suppose is technically true, but it’s misleading. Sidebar IDs are automatically generated. They look like sidebar-1, sidebar-2, etc, and are different from the names you give a sidebar when you register it.

Here’s a little function you can use to see what your sidebars look like (don’t use this on a live site!):

`function what_are_my_sidebars_called() {

global $wp_registered_sidebars;

print “

"; print_r($wp_registered_sidebars); print "

“; die();

}

add_action( ‘wp_head’, ‘what_are_my_sidebars_called’, 1 );

Skip to toolbar