Admin Area

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

  • Recent Comments
  • Incoming Links
  • New Plugins
  • Drafts
  • WordPress News

You can even add your even widgets to the dashboard, there is a good plugin that creates a widget with your Google analytics report on your dashboard.

But things like analytics you might not want to show to everyone who can login to the dashboard, so you will need to remove certain widgets.

To remove widgets from the dashboard you can use the following snippet and add it to your functions.php.

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');
Back to top

Learn how to code with Treehouse

  • Learn projects with access to 1000+ videos
  • Practice live with our Code Challenge Engine
  • Get help in our members-only forums

Start with a 7 day free trial