Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This code removes all your widgets from all widget areas on your home page. You can change the conditional tag to disable widgets from loading on specific pages etc.
add_filter( 'sidebars_widgets', 'remove_homepage_widgets' );
function remove_homepage_widgets( $sidebars_widgets ) {
if ( is_home() )
$sidebars_widgets = array( false );
return $sidebars_widgets;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment