Remove WordPress Default Widgets

A neat snippet to remove all WordPress default widgets. Might come handy for you in the future if your client decided that they don’t need the default widgets.

// Remove WP default widgets
function risbl_remove_wp_default_widgets() {
     unregister_widget('WP_Widget_Tag_Cloud');
     unregister_widget('WP_Widget_Pages');
     unregister_widget('WP_Widget_Links');
     unregister_widget('WP_Widget_Text');
     unregister_widget('WP_Widget_Archives');
     unregister_widget('WP_Widget_Calendar');
     unregister_widget('WP_Widget_Recent_Comments');
     unregister_widget('WP_Widget_RSS');
     unregister_widget('WP_Nav_Menu_Widget');
     unregister_widget('WP_Widget_Recent_Posts');
     unregister_widget('WP_Widget_Categories');
     unregister_widget('WP_Widget_Meta');
     unregister_widget('WP_Widget_Search');
}
add_action('widgets_init', 'risbl_remove_wp_default_widgets', 11);

 63 total views,  1 views today

Leave a Comment

Your email address will not be published. Required fields are marked *