Remove Default Dashboard Widgets
Cleans up the Dashboard by removing the Quick Draft, WordPress Events and News, and Activity widgets.
Opens WPIDE on
Code
add_action( 'wp_dashboard_setup', function () {
// Widget ID => context. Delete a line to keep that widget.
$widgets = array(
'dashboard_quick_press' => 'side',
'dashboard_primary' => 'side',
'dashboard_activity' => 'normal',
);
foreach ( $widgets as $id => $context ) {
remove_meta_box( $id, 'dashboard', $context );
}
}, 99 );
Notes
Other core widget IDs: dashboard_right_now (At a Glance), dashboard_site_health (Site Health Status).
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.