How to remove default WordPress dashboard widgets

WordPress comes with a number of built-in dashboard widgets, some these widgets are really helpful others aren’t necessary for a standard user. For most of my clients this is just a mess that slow down the website.

Useful Read:

In this Post, we are going to remove these default WordPress dashboard widgets which are placed on your dashboard at the time of installation. To remove these widget all you need to do is copy the following code and paste it inside your functions.php file

//Remove default dashboard widgets
add_action('wp_dashboard_setup', 'hide_default_wp_dashboard_widgets' );
function hide_default_wp_dashboard_widgets() {
	global $wp_meta_boxes;
        unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']); 
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']);
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
 
}

 

2 Comments

  1. Ooh this looks like a handy trick to know – from personal experience I pretty much never look at the dashboard or have much need for it so perhaps it can be re-purposed. This is especially handy if you’re adding your own metaboxes to the dashboard and need to make room, or have plugins that do that. Thanks for the tip!

    Reply

Leave a Comment.