in WordPress

How To Remove WordPress Dashboard Widgets

On the Wordpress dashboard you get to see lots of information about your current Wordpress site. You get things like:

Wordpress Dashboard

function disable_dashboard_widgets() {  

    remove_meta_box('dashboard_right_now', 'dashboard', 'core');  
    remove_meta_box('dashboard_recent_comments', 'dashboard', 'core');  
    remove_meta_box('dashboard_incoming_links', 'dashboard', 'core');  
    remove_meta_box('dashboard_plugins', 'dashboard', 'core');  
    remove_meta_box('dashboard_quick_press', 'dashboard', 'core');  
    remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core');  
}  
add_action('wp_dashboard_setup', 'disable_dashboard_widgets');

This snippet will disable all the widgets on your dashboard, but you can just pick ones you want to hide. But you might just want to hide these for certain users, such as if the user isn't the admin then hide these widget. Copy the following snippet to disable all widget if the user isn't the admin user.

function disable_dashboard_widgets() {  
    global $current_user;  
    get_currentuserinfo();

    if($current_user->user_level != 1){
        remove_meta_box('dashboard_right_now', 'dashboard', 'core');  
        remove_meta_box('dashboard_recent_comments', 'dashboard', 'core');  
        remove_meta_box('dashboard_incoming_links', 'dashboard', 'core');  
        remove_meta_box('dashboard_plugins', 'dashboard', 'core');  
        remove_meta_box('dashboard_quick_press', 'dashboard', 'core');  
        remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core');  
    }
}  
add_action('wp_dashboard_setup', 'disable_dashboard_widgets');

WordPress Welcome Panel

If you would like to remove the welcome panel in the admin area, you can use the WordPress action welcome_panel.

remove_action('welcome_panel', 'wp_welcome_panel');

Dashboard Activity

In WordPress 3.8 a new meta box was added for the dashboard activity to remove this meta box you need to use the following code.

remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');

Subscribe To The Weekly Newsletter

Get weekly updates to your email