Skip to content

Instantly share code, notes, and snippets.

@pavlo-bondarchuk
Created February 1, 2020 16:50
Show Gist options
  • Select an option

  • Save pavlo-bondarchuk/7ee20ac339f99c98a9d6918694f650e0 to your computer and use it in GitHub Desktop.

Select an option

Save pavlo-bondarchuk/7ee20ac339f99c98a9d6918694f650e0 to your computer and use it in GitHub Desktop.
Removing default Dashboard Widgets
function wporg_remove_all_dashboard_metaboxes() {
// Remove Welcome panel
remove_action( 'welcome_panel', 'wp_welcome_panel' );
// Remove the rest of the dashboard widgets
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
remove_meta_box( 'health_check_status', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');
}
add_action( 'wp_dashboard_setup', 'wporg_remove_all_dashboard_metaboxes' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment