Adam Baney

How to Remove WordPress Dashboard Widgets

After having an interesting conversation with “Support” regarding an article titled, “How to Remove WordPress Dashboard Widgets” at wpbeginner.com, I decided to make public the code that was intentionally removed from my comments.

The first response from “Support” confused me, although, he was right, I did provide the incorrect URL. However, on the next comment, I provided the correct URL. The URL was removed, and he made it sound like I was referencing how to hide the dashboard widgets with the Screen Options tab in WordPress. I wasn’t referencing that feature. I know what I was talking about. I then realized that he might have been removing the links because he didn’t like that the links could direct people to others’ sites—competitors’ sites? So, instead, he made it sound like I was confused. Wow. Is that how tech support should treat a potential customer? Thanks WPBeginner Support. I know what I’m doing; and, Mr. WPBeginner Support, I know what you’re doing too. :)

Anyway, on to the fun bit!

I don’t use most of the WordPress dashboard widgets that come standard with WordPress. They tend to add unnecessary blocks of information to my screen, and I have to hide them each time I create a new site or add a new user. Why not remove them entirely?

There is a way. WPBeginner showed an excellent way of doing this. Fast forward (to use a 90s term) 3 years, I found a better way of doing just this utilizing the WordPress API.

Here’s the code in all its glory:

// disable default dashboard widgets
function disable_default_dashboard_widgets() {

	//remove_meta_box('dashboard_right_now', 'dashboard', 'core');
	remove_meta_box('dashboard_activity', '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');
	remove_meta_box('dashboard_primary', 'dashboard', 'core');
	remove_meta_box('dashboard_secondary', 'dashboard', 'core');
}
add_action('admin_menu', 'disable_default_dashboard_widgets');

Source (Scroll about half-way down the page.)

Add the above code to the functions.php file in your theme’s directory, or add it to a custom plugin for use in multiple sites, and you’re done! Check out your new, improved, cleaner WordPress Dashboard, and bask in its refreshing beauty…and ease of use.

At least our conversation led to my first blog “code” article! Thanks, WPBeginner, for that much. ;)

1 year ago | Oct 12, 2015 | 0 Responses

Leave a reply

Your email address will not be published. Required fields are marked *