Deactivate WordPress Default Widgets

You do not always want to have all the widgets active, which comes within the WordPress core.

You can disable the unneccessary Widgets in your functions.php of your theme with a small function. The following syntax will switch off all the standard widgets. It should therefore be adjusted depending on your requirements:

// unregister all default WP Widgets
function unregister_default_wp_widgets() {













add_action('widgets_init', 'unregister_default_wp_widgets', 1);

The function unregister_widget() needs as parameters the class, therefore the code is working since version 2.8 only. In prior versions, Widgets were supported differently.

How to create your own Widgets since WordPress Version 2.8 is explained in Build A WordPress 2.8 Widget With The New Widget API.





5 responses to “Deactivate WordPress Default Widgets”

  1. Mael Avatar

    Will this load sidebar faster ?
    Or you just want to disable the unuseful widget for users ?

  2. Frank Avatar

    @Mael: no, its not for the performance, is for a customzing in backend for custom. Maybe you write a theme with widgtets, and the custom will only your new widgets for his users in backen – you must deaktive the default widgets.

  3. Hristo Avatar

    Does anyone know how can I unregister the Menu Nav Widget?

  4. Michael Avatar

    @Hristo: unregister_widget('WP_Nav_Menu_Widget');

  5. Debbie Avatar

    This worked amazingly well, thanks.

    The one thing I’m still desperately looking for and can’t seem to figure out is how to, within multisite, have some widgets already activated on the sidebars by default for every user activating this theme.

    I would like to have them activated on the sidebars by default without hardcoding them in the theme, because I would like my users to drag them out if they prefer, or move them around on different sidebars.

    It’s slightly off topic but I would really appreciate it if someone knew how to do this. I did find someone asking the same thing on the wordpress forums but nobody knew the answer over there.