Created
September 3, 2021 10:07
-
-
Save dr5hn/f8171cb6f566939feab7591f76a35f11 to your computer and use it in GitHub Desktop.
Remove default Wordpress admin dashboard widgets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Remove Unwanted Dashboard Widget | |
*/ | |
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 | |
remove_meta_box('dashboard_site_health', 'dashboard', 'normal'); // Site Health | |
} | |
add_action('admin_init', 'remove_dashboard_meta'); | |
/** | |
* Remove Site Health Sub Menu Item | |
*/ | |
add_action('admin_menu', 'remove_site_health_menu'); | |
function remove_site_health_menu() | |
{ | |
remove_submenu_page('tools.php', 'site-health.php'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment