Skip to content

Instantly share code, notes, and snippets.

@duongthanhthai
Created October 25, 2019 09:18
Show Gist options
  • Save duongthanhthai/35387c839dbd685d7227519d097be843 to your computer and use it in GitHub Desktop.
Save duongthanhthai/35387c839dbd685d7227519d097be843 to your computer and use it in GitHub Desktop.
Remove default admin dashboard widgets (Activity, WordPress News, Quick Draft and At a Glance) from the WordPress admin dashboard for all users.
function remove_dashboard_meta() {
remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' ); // Activity
remove_meta_box( 'dashboard_primary', 'dashboard', 'normal' ); // WordPress News
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); // Quick Draft
remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); // At a Glance
}
add_action( 'admin_init', 'remove_dashboard_meta' );
@darinronne
Copy link

Looks like there is a new one to add.

remove_meta_box( 'dashboard_site_health', 'dashboard', 'normal' ); // Site Health Status.

@duongthanhthai
Copy link
Author

duongthanhthai commented Nov 6, 2021

remove_meta_box( 'e-dashboard-overview', 'dashboard', 'normal' ); // Elementor 
remove_meta_box( 'yith_dashboard_products_news', 'dashboard', 'normal' ); //yith_dashboard_products_news
remove_meta_box( 'yith_dashboard_blog_news', 'dashboard', 'normal' ); //yith_dashboard_blog_news'

@duongthanhthai
Copy link
Author

remove_meta_box( 'wc_admin_dashboard_setup', 'dashboard', 'normal' ); //WooCommerce Setup

@duongthanhthai
Copy link
Author

`remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal', 'core', 'side' );
remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal', 'core', 'side' );
remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal', 'core', 'side' );
remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'normal', 'core', 'side' );
remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal', 'core', 'side' );
remove_meta_box( 'dashboard_welcome_panel', 'dashboard', 'normal', 'core', 'side');
remove_action('welcome_panel', 'wp_welcome_panel');
remove_action('elementor-message', 'elementor-message');
remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );

// oceanwp
remove_meta_box( 'owp_dashboard_news', 'dashboard', 'normal', 'core', 'side');
// elementor
remove_meta_box( 'e-dashboard-overview', 'dashboard', 'normal', 'core', 'side');
// monsterinsights
remove_meta_box( 'monsterinsights_reports_widget', 'dashboard', 'normal', 'core', 'side');
// monsterinsights
remove_meta_box( 'rank_math_dashboard_widget', 'dashboard', 'normal', 'core', 'side');
// bbpress
remove_meta_box( 'bbp-dashboard-right-now', 'dashboard', 'normal', 'core', 'side');
// yoast seo
remove_meta_box( 'yoast_db_widget', 'dashboard', 'normal', 'core', 'side');
// gravity forms
remove_meta_box( 'rg_forms_dashboard', 'dashboard', 'normal', 'core', 'side');
// tinypng
remove_meta_box( 'tinypng_dashboard_widget', 'dashboard', 'normal', 'core', 'side');`

@duongthanhthai
Copy link
Author

remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal', 'core', 'side' );
remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal', 'core', 'side' );
remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal', 'core', 'side' );
remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'normal', 'core', 'side' );
remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal', 'core', 'side' );
remove_meta_box( 'dashboard_welcome_panel', 'dashboard', 'normal', 'core', 'side');
remove_action('welcome_panel', 'wp_welcome_panel');
remove_action('elementor-message', 'elementor-message');
remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );

// oceanwp
remove_meta_box( 'owp_dashboard_news', 'dashboard', 'normal', 'core', 'side');
// elementor
remove_meta_box( 'e-dashboard-overview', 'dashboard', 'normal', 'core', 'side');
// monsterinsights
remove_meta_box( 'monsterinsights_reports_widget', 'dashboard', 'normal', 'core', 'side');
// monsterinsights
remove_meta_box( 'rank_math_dashboard_widget', 'dashboard', 'normal', 'core', 'side');
// bbpress
remove_meta_box( 'bbp-dashboard-right-now', 'dashboard', 'normal', 'core', 'side');
// yoast seo
remove_meta_box( 'yoast_db_widget', 'dashboard', 'normal', 'core', 'side');
// gravity forms
remove_meta_box( 'rg_forms_dashboard', 'dashboard', 'normal', 'core', 'side');
// tinypng
remove_meta_box( 'tinypng_dashboard_widget', 'dashboard', 'normal', 'core', 'side');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment