Remove Widgets from WordPress Dashboard Without a Plugin

No plugins required

Have you ever logged into your site, and became suddenly annoyed at all the random advertisements, that are disguised as important messages?

If you are at this point, you most likely have a full website, with too many plugins, and too many messages in your dashboard.  

Keep in mind that every plugin you add to your site will add a new CSS file, and a new JS file that has to load whenever someone visits your site.  You want your website running fast, not bogged down with extra plugins.  

Slower sites results in a higher bounce rate of visitors.  Meaning, they will more likely leave your site and never come back!

I wrote this article with that in mind, and I will focus on There are ways of Customizing your WordPress dashboard without jeapardizing your websites speed. 

This article will focus on how to remove the current widgets from your WordPress dashboard, to create a cleaner and lighter custom dashboard. 

Create a child-theme first

Let’s focus on cleaning up your WordPress dashboard.  There are already plenty of widgets taking up space, that you never requested.  Luckily they are easy to remove!

Before we go further, let’s create a quick child-theme.   This way, all core file changes we make stay intact.  If what I just said scares you, this is easier than you think, just follow these steps!   If you already have one, you can skip ahead.  

  1. Create your child-theme folder:   Jump into your File Manager, and find your website root directory (the folder your website is in).  Then, navigate to wp-content/themes.  Within this folder, create a ‘New Folder’, and name it “currenttheme-child”.  Example:  I have a Divi Theme, so I created a new folder called “Divi-child”.
  2. Create your child-themes CSS file:  Now that you have a new child-theme folder, you can add a ‘style.css’ file to tweak the look of your site later.  Create a ‘New File’, and rename it “style.css”.  Now edit the file, and add the following code (just copy and paste, you are not required to know any coding).  This goes at the top of the file.
Theme Name: Your Child Theme Folder Name Here
Description: Child theme for Parent Theme Name Here
Author: Your Name Here
Template: Parent Theme Name Here
  1. Create your child-themes function.php file:  Go back inside your child-theme’s folder, and create a ‘New File’, and rename it “functions.php”. Next, edit the file and copy/paste the code below to the top of the blank file.

function myprefix_theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
add_action( 'wp_enqueue_scripts', 'myprefix_theme_enqueue_styles' ); ?>

You can add much more to your child-theme, but we are just covering the bare essentials!  For another example, check out the article ‘How to create a child theme with Divi’.   

Remove unwanted WordPress dashboard widgets

When logged into your WordPress dashboard, you may notice a couple sections (widgets) such as Unpublished Drafts, Quick Stats, At a Glance, WordPress News, among others.  

Most of these dashboard widgets are pre-added by WordPress, but the number of widgets displayed could go up or down depending on your theme and/or plugins.  Some themes and plugins add their own widgets to the dashboard.

While some widgets may be of use, do you really need them all there?  Do your clients need to see them?  Do you/they need to see each of these widgets every time you log in?  

Perhaps you had to put up with these widgets because you had no way of getting rid of them, like me.  When I found out how easy it was to remove as many dashboard widgets as I wanted to..  I just had to share! 

Best part is, you can do this without weighing your site down with another plugin, only using a few lines of code!

Remove widgets for all users except admin

There are a couple different ways we can accomplish this.  The first way is to hide the dashboard widgets for everyone EXCEPT the admin, to do this, copy the following code:

// Remove dashboard widgets
function remove_dashboard_meta() {
	if ( ! current_user_can( 'manage_options' ) ) {
		remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
		remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
		remove_meta_box( 'dashboard_primary', 'dashboard', 'normal' );
		remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );
		remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
		remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );
		remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
		remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
		remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');
add_action( 'admin_init', 'remove_dashboard_meta' ); 

Copying the above code in your child-theme’s functions.php file (found at wp-content/themes/yourthemename/child-theme/functions.php) a couple lines below the previous code we had written, and then saving changes will eliminate all dashboard widgets with the exception of those added by your theme or plugins.  

From the code above, all users with less than admin capabilities won’t see the widgets thanks to this part of the code:

if ( ! current_user_can( 'manage_options' ) )

…which checks if the user has (‘manage_options’) capability only available to administrators.

Remove widgets for ALL users

The following code will hide the dashboard widgets for ALL users.  Also, in case you don’t want to rid the dashboard of all widgets, we narrowed it down so you can choose which ones to get rid of:

// Create the function to use in the action hook
function wpexplorer_remove_dashboard_widget () {
    remove_meta_box ( 'dashboard_quick_press', 'dashboard', 'side' );
add_action ('wp_dashboard_setup', 'wpexplorer_remove_dashboard_widget');

If you want the widgets gone for ALL users, copy the above code into your functions.php file, a couple lines below where we started the child-theme originally, and save changes.  This will get rid of one widget, Quick Press.  

To remove any other widget, just replace ‘dashboard_quick_press’, ‘dashboard’, ‘side’ with corresponding slug for each widget. Other standard widget slugs include:

  • dashboard_incoming_links
  • dashboard_plugins
  • dashboard_primary
  • dashboard_secondary
  • dashboard_quick_press
  • dashboard_recent_drafts
  • dashboard_recent_comments
  • dashboard_right_now
  • dashboard_activity

You might have additional widgets added by your parent theme, other plugins you have installed, or even your hosting. 

To find the slug for these added widgets, use a browser inspector (in Chrome, right click on any element and choose “inspect”) then copy the div ID for the widget you want to remove.

And that's it!

You now have a clean and clutter free WordPress Dashboard!  Keep checking in, as we will post how to add widgets to your WordPress dashboard later on.

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest