Remove Widgets from WordPress Dashboard

Applies to Version(s): WordPress

Whether you’re setting up a streamlined installation for a client or you’re looking to cut some overhead on your own site, one very easy thing to do is to customize which admin panel dashboard widgets are loaded.

The obvious way to do this is to simply select “Screen Options” near the top of the dashboard. The screen options allow you to hide unused widgets, but the big disadvantage of this is that the hiding is done client-side: all of the widgets are still processed and loaded, even if they aren’t displayed.

With just a simple bit of code dropped into your Thesis custom_functions.php file, you can easily choose which widgets WordPress uses to build your site’s dashboard:

/**
 * Dashboard widgets
 */
function custom_remove_dashboard_widgets() {
	global $wp_meta_boxes;
	unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press'] ); # Allows for basic post entry
	unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] ); # Shows you who is linking to you
	unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] ); # Displays new, updated, and popular WordPress plugins on WordPress.org
	unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] ); # Highlights entries from the WordPress team on WordPress.org
	# unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] ); # Displays stats about your blog
	# unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] ); # Displays the most recent comments on your blog
	# unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts'] ); # Displays your most recent drafts
	# unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'] ); # Displays the WordPress Planet feed, which includes blog entries from WordPress.org
}
add_action( 'wp_dashboard_setup', 'custom_remove_dashboard_widgets' );

Descriptions of each of the widgets are inline within the code, and you can choose which of the eight widgets to show with the # character: A line with a # at the beginning of it will allow that widget to load, while a line without a beginning # will remove the associated widget.