How to Unregister WordPress Default Widgets

Tired of that huge amount of Widgets list cluttering the add/remove widget page? With this piece of code you are going to be able to remove all that unused ones and keep only the ones you might use.

// 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);

Compartilhar:

3 Comentários. Comentar

Vincent Miele
20 de fevereiro de 2013 20:42

Ok, so where is this code supposed to go?

Responder
Lighten Up Therapies
17 de março de 2013 23:06

good question

Responder
Rodolfo Martinez Iglesias
26 de março de 2013 14:48

Yep, where?

Responder
Comente