How to Remove WordPress Dashboard Widgets

Working on a recent project, a client asked me to clean up all the widgets that shown on default WordPress Dashboard as soon as you login. They were not using any of those widgets so wanted to see a clean dashboard upon logging in.

Removing default Dashboard Widgets is easy by adding few lines of codes into your theme’s functions.php file.

Copy the following code and paste it in your functions.php.

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', 'side' );
        remove_meta_box( 'dashboard_secondary', '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' );
        remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');//since 3.8
}
add_action( 'admin_init', 'remove_dashboard_meta' );

Source

Leave a Reply

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