How to remove a widget from the WordPress Dashboard permanently

widget-be-goneIf you want to never see a widget on your WordPress Dashboard ever again, just head over to the top where it says “Screen Option”, then simply un-tick the ones you don’t like.

That’s Zen Therapy right there. These preferences are saved on a per-user basis.

But what if you don’t want certain widgets to show up, because your client gets confused by all the dashboard clutter? I know I do!

Help is at hand: you can use a couple of neat functions in your theme (or plugin) so certain widgets never even show up. Let’s see how this works.

What WordPress calls Widgets

By default, you have four widgets on the left, and four on the right hand side in the Dashboard. The left hand side is known as “normal”, and the right hand side is known as “side”. You need to know which side your widget is on.

You also need to know what a Widget is called. Here’s a list of each Widget’s title, what WordPress knows it by and which side it appears on:

Right Now

  • dashboard_right_now
  • normal

Recent Comments

  • dashboard_recent_comments
  • normal

Incoming Links

  • dashboard_incoming_links
  • normal

Plugins

  • dashboard_plugins
  • normal

Quick Press

  • dashboard_quick_press
  • side

WordPress Blog

  • dashboard_primary
  • side

Other News

  • dashboard_secondary
  • side

Now that we know how to address those suckers, let’s see how we can eliminate them for good.

Here’s how to get rid of “Plugins” and “Other News”. This code can be used in your theme’s functions.php file, or in a plugin.

//Remove unwanted widgets from Dashboard
function remove_dashboard_widgets() {
	global$wp_meta_boxes; 
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}
add_action('wp_dashboard_setup', 'remove_dashboard_widgets');

The two lines starting with “unset” are the important ones: the last parameter defines the widget, and the parameter before “core” tells WordPress which side (left or right / normal or side) we’d like to remove it from.

Remove as many widgets as you like simply by copying the entire line starting with “unset”, and then replacing title and side accordingly. To bring them back, simply delete the code from your functions.php file.

If you’d like to know more about WordPress Widgets, check out the API documentation: http://codex.wordpress.org/Dashboard_Widgets_API

Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or drawing on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.