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:

{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.

Free Video Why 100 is NOT a Perfect Google PageSpeed Score (*5 Min Watch) Learn how to use Google PageSpeed Insights to set realistic goals, improve site speed, and why aiming for a perfect 100 is the WRONG goal.
Sarah Gooding
Sarah Gooding Sarah enjoys staying on top of the latest WordPress and BuddyPress news. Get in touch with Sarah on Twitter @pollyplummer.
Did you find this simple WordPress tip useful? Should we publish more? Let us know in the comments below.