Remove panels from the dashboard
How can I remove panels from the WordPress Dashboard?
To remove all panels, add this code to your functions.php file
[php]
/**
* Remove all panels from dashboard
**/
add_action(‘wp_dashboard_setup’, ‘wpster_remove_dashboard_widgets’ );
function wpster_remove_dashboard_widgets() {
global $wp_meta_boxes;
unset($wp_meta_boxes[‘dashboard’]);
}
[/php]
To choose which panel you want to remove, adapt this code and add it to your functions.php file
[php]
/**
* Remove panels from dashboard
**/
add_action(‘wp_dashboard_setup’, ‘wpster_disable_default_dashboard_widgets’, 999);
function wpster_disable_default_dashboard_widgets() {
global $wp_meta_boxes;
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_activity’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_right_now’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_recent_comments’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_incoming_links’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_plugins’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_primary’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_secondary’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_quick_press’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_recent_drafts’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘bbp-dashboard-right-now’]); // bbpress
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘yoast_db_widget’]); // yoast seo
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘rg_forms_dashboard’]); // gravity forms
}
[/php]