By default, the WordPress dashboard does look quite cluttered with too many widgets. You can of course add or remove the dashboard widgets manually, but this can be a pain if you manage a lot of sites. Also if you are building websites for clients the default widgets might be irrelevant or even confusing. The solution: remove them by default.

Just add the following code to your theme’s functions.php file and poof, the widgets are gone!


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