How to Remove Default WordPress Widgets and Clean Up Your Widgets Page

Let’s be honest – nobody uses all the default widgets that come with WordPress out of the box. In fact, there are probably a few default widgets that you would never use. Ever.

Because of this, many of those default widgets just get in the way. And so if you’d like to remove them and clean up your widgets page, there’s an easy way.

If you “unregister” a widget in your functions file, it will not appear on your widgets page. If you’d ever like it to appear again, simply go back into your functions file and remove the code you put in to unregister it.

Below is the code to put into your functions file to remove ALL the default widgets that come with WordPress. You can pick and choose which ones you’d like. If you’d like to keep your text widget, for example, then simply remove the line of code for the text widget:



Place the following in your functions file (Appearance > Editor > Theme Functions – functions.php):


// unregister all widgets
 function unregister_default_widgets() {
 add_action('widgets_init', 'unregister_default_widgets', 11);


Featured Plugin - WordPress Pop-Up Chat Plugin

No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more

Here’s a look at all the default widgets:

And here’s a look at the default widgets removed:

Featured Plugin - WordPress Wiki Plugin

To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more



Photo: Pretty Woman Cleaning from BigStock



Tags , ,

Comments (8)

  1. Great! I have one question, regarding the line:

    add_action('widgets_init', 'unregister_default_widgets', 11);

    When you’re passing the ’11’ parameter, what does it refers to? I mean, If I remove more or less widgets, will it affect somehow?

    Thanks a lot, really useful stuff ;)

  2. Sorry, but that’s all wrong. All of it. Seriously. You never know which widgets were registered and which weren’t, which are the standard ones and which came with a theme or plugin. Like you’re trying to unregister the Twenty Eleven Ephemera widget, what if the Twenty Eleven theme is not active? What if two more default widgets are added to Core in 3.4? Dude, all you had to do was read the default-widgets.php file to realize you can remove them in one line, and still run widgets_init in another one line ;)

    remove_action( ‘init’, ‘wp_widgets_init’, 1 );
    add_action( ‘init’, function() { do_action( ‘widgets_init’ ); }, 1 );