Declutter WordPress: Remove widgets from the WordPress Dashboard
by Moises Kirsch
For most users the WordPress Dashboard can be overwhelming.
Recently I had to show a client how to add, remove and edit content using WordPress and as easy as it might seem, he was very confused with all the extra options that most users don’t understand or even use.
So I decided to hide must of the stuff and simplify the administration panel as much as possible. To accomplish this, I used a few tricks that I’ll be posting about in a series of posts.
The first page that any user sees after log-in in is the Dashboard. It is full with technical news, WordPress related stuff and things that a lawyer or a doctor wouldn’t understand and they don’t even care.
So the first thing that I did was to remove everything from that screen.
// Remove Dashboard Widgets
function remove_dashboard_widgets(){
// Globalize the metaboxes array that holds all the widgets for wp-admin
global $wp_meta_boxes;
// Unset the unwanted widgets
// 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_quick_press']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}
// Hoook into the 'wp_dashboard_setup' action to register our function
add_action('wp_dashboard_setup', 'remove_dashboard_widgets');
You could even create an IF statement and only hide this from certain user role.
Comments
Ridiculus. There’s a little tab on the dashboard that says “Screen Options”. Point your clients to that. What’s so hard about giving a bit of attention to a new task? If they “don’t understand or even care” about that, they’re not even supposed to come to wp-admin, leave it to someone else who does care. To disable stuff with php and call it “decluttering” is a horrible hack and an insult to clients intelligence.
Grumpy.
This wee wonderful website is wpKode.
And whadyaknow there it is, the Dashboard widget code.
I’m grateful for the efforts.
Thank you for pointing this our Moises.. some clients will appreciate a simplified version of WP.