How to: Remove widget areas on your blog homepage without editing template files

March 9, 2009 at 10:44 am

Ever wanted to be able to remove your widgetized areas (Sidebar, most of the time) on your blog homepage, but don’t feel like editing your theme files? No problem, here is the solution.

To do so, simply add the following code to your functions.php file:

<?php
add_filter( 'sidebars_widgets', 'disable_all_widgets' );

function disable_all_widgets( $sidebars_widgets ) {
	if ( is_home() )
		$sidebars_widgets = array( false );
	return $sidebars_widgets;
}
?>

That’s all, no more widgetized areas are displayed on your homepage.

Credits goes to Justin Tadlock for this awesome recipe!