Categories
Blog Code Snippets PHP Wordpress

WordPress – Deactivate a Sidebar or Widgetized Area

Here’s how to deactive a Sidebar or Widgetized Area in WordPress so it won’t show on the website and neither will it show on the Widgets section of the wordpress backend.

First, get the name of the sidebar, you may need to check the theme functions file to get exactly it is.

In this case, we will assume that the sidebar name is ‘sidebar-1’.

Add the code below to your functions file.

function remove_some_widgets(){

	// Unregister sidebar
	unregister_sidebar( 'sidebar-1' );

}
add_action( 'widgets_init', 'remove_some_widgets', 11 );

Leave a Reply