How To Remove Default Dashboard Widgets In WordPress?

WordPress dasboard shows you a lot of information about your website and WordPress news, plugins etc. The information is divided into various dashboard widgets which a user can drag, reorder or hide using screen options button. Many a times people like hiding the dashboard widgets (specially the news and welcome panel) from their websites. In this tutorial we will show you how you can easily disable the dashboard widgets globally for all users on your website.

Login to your website, open your theme’s function.php file and add the following code:

 function remove_dashboard_meta() {
        remove_meta_box( ‘dashboard_incoming_links’, ‘dashboard’, ‘normal’ );
        remove_meta_box( ‘dashboard_plugins’, ‘dashboard’, ‘normal’ );
        remove_meta_box( ‘dashboard_primary’, ‘dashboard’, ‘normal’ );
        remove_meta_box( ‘dashboard_secondary’, ‘dashboard’, ‘normal’ );
        remove_meta_box( ‘dashboard_incoming_links’, ‘dashboard’, ‘normal’ );
        remove_meta_box( ‘dashboard_quick_press’, ‘dashboard’, ‘side’ );
        remove_meta_box( ‘dashboard_recent_drafts’, ‘dashboard’, ‘side’ );
        remove_meta_box( ‘dashboard_recent_comments’, ‘dashboard’, ‘normal’ );
        remove_meta_box( ‘dashboard_right_now’, ‘dashboard’, ‘normal’ );
}
add_action( ‘admin_init’, ‘remove_dashboard_meta’ );

And for removing some selected dashboard widgets, simply remove their lines from the above code.

The given code explains everything very well.

For example:

remove_meta_box( ‘dashboard_quick_press’, ‘dashboard’, ‘side’ ); removes the ‘Quick Press’ widget. In-case if you don’t want to remove it then just delete the given line from the above code.

In the same way you can include more lines and hide other widgets:

For hiding welcome panel: remove_action(‘welcome_panel’, ‘wp_welcome_panel’);

For hiding activity metabox: remove_meta_box( ‘dashboard_activity’, ‘dashboard’, ‘normal’);

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.