Title: unregister_sidebar
Published: April 25, 2014
Last modified: August 20, 2026

---

# unregister_sidebar( string|int $sidebar_id )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/unregister_sidebar/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/unregister_sidebar/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/functions/unregister_sidebar/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/unregister_sidebar/?output_format=md#user-contributed-notes)

Removes a sidebar from the list.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/unregister_sidebar/?output_format=md#parameters)󠁿

 `$sidebar_id`string|intrequired

The ID of the sidebar when it was registered.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/unregister_sidebar/?output_format=md#source)󠁿

    ```php
    function unregister_sidebar( $sidebar_id ) {
    	global $wp_registered_sidebars;

    	unset( $wp_registered_sidebars[ $sidebar_id ] );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/widgets.php#L341)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/widgets.php#L341-L345)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/unregister_sidebar/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/unregister_sidebar/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 2 content](https://developer.wordpress.org/reference/functions/unregister_sidebar/?output_format=md#comment-content-1089)
 2.    [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/unregister_sidebar/#comment-1089)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Funregister_sidebar%2F%23comment-1089)
     Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Funregister_sidebar%2F%23comment-1089)
 4.  **Basic Example**
 5.  If added to a child theme’s functions.php file, this will remove the footer sidebars
     registered by the TwentyTen theme.
 6.      ```php
         function remove_some_widgets(){
     
         	// Unregister some of the TwentyTen sidebars
         	unregister_sidebar( 'first-footer-widget-area' );
         	unregister_sidebar( 'second-footer-widget-area' );
         	unregister_sidebar( 'third-footer-widget-area' );
         	unregister_sidebar( 'fourth-footer-widget-area' );
         }
         add_action( 'widgets_init', 'remove_some_widgets', 11 );
         ```
     
 7.  **Notes**
 8.  In the example, note that we assign a priority of 11 when registering the widgets_init
     hook. This is because a child theme’s functions.php file is called before the 
     parent theme’s, which means that our call to [unregister_sidebar()](https://developer.wordpress.org/reference/functions/unregister_sidebar/)
     would accomplish nothing since the sidebar has not yet been registered.
 9.  By lowering the priority of our action, we ensure that it is called after the 
     parent theme’s functions.php file is loaded.
 10.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Funregister_sidebar%2F%3Freplytocom%3D1089%23feedback-editor-1089)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Funregister_sidebar%2F)
before being able to contribute a note or feedback.