If 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
This is pretty neat. I hate seeing those widgets as I never use them. For client, this is really helpful for a simple dashboard for them.
Thanks Rudd, glad it was helpful. Those widgets can get extremely annoying indeed, and it’s something that puts newcomers off WordPress I find.