How To Unregister The Default WordPress Widgets And Clean Up Your Dashboard

How To Unregister The Default WordPress Widgets And Clean Up Your Dashboard

Widgets are one of the key features that makes WordPress so wonderfully easy to use. But not all of the default widgets are always needed. Yep, it’s time for a dashboard cleanse.

Everyone loves the convenience of drag and drop.

WordPress comes packaged with 12 default widgets available for use. Add that to the widgets that you get from plugins and themes and you can really go overboard.

Here’s an example:

And that’s only the available widgets – not including the inactive widgets.

This scenario happens to me quite frequently.

I find myself saying, dang it, I know this plugin I just installed is supposed to be packaged with a widget, but I’m not sure which one it is among this vast sea of widgets!

Many plugins often use similar names to the default widgets, so it can take some hunting, trial and error to figure out if you’ve got the right widget.

Let’s do a little cleanup…

If you’re not making use of many of the default widgets included with the WordPress core, here’s what you can do.

Unregister them by copying and pasting this into your theme’s functions.php file:

FREE EBOOK
Your step-by-step roadmap to a profitable web dev business. From landing more clients to scaling like crazy.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

{code type=php}
// unregister all default WP Widgets
function unregister_default_wp_widgets() {
unregister_widget('WP_Widget_Pages');
unregister_widget('WP_Widget_Calendar');
unregister_widget('WP_Widget_Archives');
unregister_widget('WP_Widget_Links');
unregister_widget('WP_Widget_Meta');
unregister_widget('WP_Widget_Search');
unregister_widget('WP_Widget_Text');
unregister_widget('WP_Widget_Categories');
unregister_widget('WP_Widget_Recent_Posts');
unregister_widget('WP_Widget_Recent_Comments');
unregister_widget('WP_Widget_RSS');
unregister_widget('WP_Widget_Tag_Cloud');
}
add_action('widgets_init', 'unregister_default_wp_widgets', 1);

You don’t have to remove all of the default widgets if you don’t want to.

If there are some in there that you plan on using, simply don’t include them in the code block.

For example, let’s say you want to remove all the defaults except for the “Recent Posts” and “Recent Comments” widgets. Delete those lines from the code block and you’ll preserve those widgets.

Don’t worry if you make a mistake – you can always bring them back.

A messy widget area isn’t necessarily a sign of untidiness, but if you like a clean work area, you’ll benefit from this little hack.

It’ll only take you about one minute to copy and paste, resulting in an instant cleanup.

Did you find this simple WordPress tip useful? Should we publish more? Let us know in the comments below.

Sarah Gooding Sarah is a designer and developer who specializes in WordPress. She and her husband operate Untame, where they build business websites, online stores, and social networks using open-source technologies. She is a former author for WPMU DEV on all things WordPress, Multisite, and BuddyPress.