|
Once you log in to your WordPress dashboard, you will notice a couple of sections (widgets) such as At a Glance, Site Stats, Quick Draft, and WordPress News among others. Most of these dashboard widgets are 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 of these widgets are useful, do your clients need to see each? Do you need to see each of these Country Email List widgets every time you log in? Perhaps you had to put up with the widgets because you had no way of getting rid of them. Today is your lucky day. You can easily remove as many dashboard widgets as you wish using a few lines of code:
Copying the above code in your child theme’s functions.php file (found at wp-content/themes/yourthemename/child-theme/functions.php) and saving the 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.
which checks if the user has (‘manage_options’) capability only available to administrators. Perhaps you don’t want to rid your dashboard of all widgets. You can use the following code instead:
Copy the above code to your functions.php file and save changes to get rid of the Quick Draft widget. To remove any other widget, just replace ‘dashboard_quick_press’, ‘dashboard’, ‘side’ with corresponding slug for each widget. Other standard widget slugs include.
|
|