By default, WordPress comes with a lot of items on the dashboard that most people would never use. So why would you want to remove dashboard widgets in WordPress?
The problem with having a lot of options on the dashboard is that it not only makes the dashboard look cluttered but also can negatively impact your blogging productivity.
Besides this, if you are developing a WordPress website for a client, leaving unnecessary options and choices will lead to confusion and a higher risk of breaking your hard web design work.
Although WordPress ships with ‘screen options’ from where you can disable showing unwanted items on the dashboard, sometimes for the sake of simplicity you might want to completely remove these unwanted dashboard items even from the ‘screen options’.
Again, if you are developing a WordPress theme for a client who is an absolute novice to the WordPress environment, it makes sense to avoid everything that can make them confused, which can also help to improve the overall user experience.
The goal of this tutorial is thus, to completely remove the unwanted dashboard items not only from the dashboard screen but from the ‘screen options’ as well.
Here’s how the dashboard items and the ‘screen options’ will look like before implementing the below code to your WordPress site.
Here’s how it looks after implementing it.
In this tutorial, you’ll find how to remove:
- 'At a glance’ item from the dashboard
- WordPress news feed from the dashboard
- Quick draft option from the dashboard
Code to Remove WordPress Dashboard Widgets
Simply add the following code snippet to your functions.php file to remove unnecessary items from dashboard and the ‘screen options’. If you're worried that you might break something, take a backup using one of these plugins.
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
}
Remove only the options you want
Many times, you might not want to remove all of those items from the dashboard and the ‘screen options’ as given in the above code snippet. In such cases, you can remove only specific items from your dashboard that you feel you might not want to use.
Take a look at below to know which snippets are responsible for each action. If you think any of them is necessary you may remove it from the above code before adding it to your functions.php file.
At a glance:
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
WordPress news feed:
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
Removing quick draft:
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
Decide which ones you want to leave and which ones you want to remove and for the ones which you don’t want, LEAVE it in the code. This is because we are asking the code to UNSET, i.e. remove the option, rather than specifying which ones we want to leave.
This code edit once in place will allow you to remove widgets or customize any unwanted items in the WordPress dashboard.
At CollectiveRay we've also created a whole list of WordPress tips and tricks that every blogger should know - check it out!
Please leave a useful comment with your thoughts, then share this on your Facebook group(s) who would find this useful and let's reap the benefits together. Thank you for sharing and being nice!
Disclosure: This page may contain links to external sites for products which we love and wholeheartedly recommend. If you buy products we suggest, we may earn a referral fee. Such fees do not influence our recommendations and we do not accept payments for positive reviews.