How to remove widgets from the WordPress Dashboard

Have you ever wanted to tidy up the WordPress dashboard? Perhaps you’re building a site for a client who may get confused by all the widgets that appear by default. You can indeed hide these for your user account when you log in to WordPress (under the ‘screen options’ section on the dashboard) but the remove_meta_box() function allows you to remove these widgets from WordPress altogether. Here’s an example of the default WordPress dashboard:

WordPress Dashboard

As you can see, there are a range of widgets here…some of which you probably don’t need. The code below will remove all widgets from the dashboard:

function remove_dashboard_meta() {
    remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); //Removes the 'incoming links' widget
    remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); //Removes the 'plugins' widget
    remove_meta_box('dashboard_primary', 'dashboard', 'normal'); //Removes the 'WordPress News' widget
    remove_meta_box('dashboard_secondary', 'dashboard', 'normal'); //Removes the secondary widget
    remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); //Removes the 'Quick Draft' widget
    remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side'); //Removes the 'Recent Drafts' widget
    remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); //Removes the 'Activity' widget
    remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); //Removes the 'At a Glance' widget
    remove_meta_box('dashboard_activity', 'dashboard', 'normal'); //Removes the 'Activity' widget (since 3.8)
}
add_action('admin_init', 'remove_dashboard_meta');

All you have to do is paste this into your theme’s functions.php file. You can keep the widgets you want by simply removing their lines of code from the snippet above.

You can even hide the ‘WordPress * is available! Please update now ‘ message that appears when your current version of WordPress is out of date, using the code below:

remove_action('admin_notices', 'update_nag');

Just add this line to the remove_dashboard_meta() function that you added previously.

Looking to start a project? Let’s work together. Email info@adamboother.com.