How to Remove WordPress Dashboard Widgets

Whenever I develop a site for a client, I’ll try to make the dashboard to be as clear and easy to be used as possible. This is important to avoid confusion to the client, thus reducing support time. Everybody wins.

One of the little things I always do is remove unnecessary dashboard widgets as most of the time, no one will ever use it, me included.

Note: The dashboard widgets should not be confused with the widgets. The dashboard widgets are what you see in Dashboard > Menu.

Using remove_meta_box() Function

The unnecessary dashboard widgets can be removed using remove_meta_box() funtion. Simply use the following code in functions.php of your theme or even better, the functionality plugin.

Below is a list of default WordPress widgets and some code to remove it from your dashboard:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?php
//* Remove WordPress dashboard widgets
function afn_remove_dashboard_widgets() {
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );
remove_meta_box( 'dashboard_browser_nag', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
}
add_action('wp_dashboard_setup', 'afn_remove_dashboard_widgets' );
view raw functions.php hosted with ❤ by GitHub

For more information, please read about WordPress Dashboard API from WordPress Codex.

Using Plugin

There are many plugins available to get what we’re trying to archive. One of my favorite plugins is Adminimize. The plugin gives you more control - it allows you to remove the default WordPress widgets based on different user roles. This is a great feature if you’d like to remove the widgets from only certain level of users.

dashboard widgets

Comments

  1. Jane says

    Wow this sounds like a handy solution. Seriously I was not aware of this until I read your post. But for sure I’ve had that annoying feeling when I see my WP dashboard cluttered!

    Thanks so much!

  2. Qasim says

    Hi,

    That is really amazing news, and the good news that there is a plugin to do it as I am not into coding thing. Thank you for sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *