Remove default dashboard widgets
Clean up the WordPress Dashboard by removing Events and News, Quick Draft, Activity, At a Glance, Site Health and the Welcome panel.
// Remove default Dashboard widgets. Delete any line for a widget you want to keep.
add_action(
'wp_dashboard_setup',
function () {
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); // WordPress Events and News.
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); // Quick Draft.
remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' ); // Activity.
remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); // At a Glance.
remove_meta_box( 'dashboard_site_health', 'dashboard', 'normal' ); // Site Health Status.
remove_action( 'welcome_panel', 'wp_welcome_panel' ); // Welcome panel.
}
);
What it does
The WordPress Dashboard comes with widgets most clients never use. This snippet removes WordPress Events and News, Quick Draft, Activity, At a Glance, Site Health Status and the Welcome panel for every user.
Each widget has its own line with a comment, so you can delete the lines for widgets you want to keep.
Good to know
- Users can already hide widgets for themselves under Screen Options. This snippet removes them for everyone.
- Widgets added by plugins, such as WooCommerce, aren't affected.