Archived topic
How to remove all GP sidebar?
3 replies · Started by DIMO Software on June 23, 2018
Hi
What is filter to remove all default sidebars generated by GP in /wp-admin/widgets.php?
Don't want to hide them, but really do not want any of them because we are building a full Elementor website. thank you
Hi there,
You can remove them globally here:
https://docs.generatepress.com/article/sidebar-layout/
Let me know if this helps.
But that do not remove them from, this, below, does, I'm not sure it the clean/right way to do it...
add_action( 'widgets_init', 'remove_some_sidebars', 99);
function remove_some_sidebars(){
unregister_sidebar( 'sidebar-1' );
unregister_sidebar( 'sidebar-2' );
unregister_sidebar( 'header' );
unregister_sidebar( 'footer-1' );
unregister_sidebar( 'footer-2' );
unregister_sidebar( 'footer-3' );
unregister_sidebar( 'footer-4' );
unregister_sidebar( 'footer-5' );
unregister_sidebar( 'footer-bar' );
unregister_sidebar( 'top-bar' );
}
Looks correct to me.
Tom provided something similar before:
https://generatepress.com/forums/topic/unregister-widget-areas/#post-334993