Removing Widgets from your Widget page in the admin.


Over the last few years, I have been following the works of a handful of WordPress Developers and in doing so, I have learned a lot of great tips and tricks from security enhancements to making simple tweaks to the admin interface for easier site management.

Here is one that I almost always use now:

Remove or unregister widgets that aren’t wanted and needed.  Simply add this to the functions.php file and then when you into your widgets page, all of the widgets will be removed.

Now, say you want to keep a few of them.  Well, you can add a // in front of the line with the widget you want to keep or simply remove the line of that widget.

// unregister all widgets
function remove_default_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’);
unregister_widget(‘WP_Nav_Menu_Widget’);
}
add_action(‘widgets_init’, ‘remove_default_widgets’, 11);

Check back again for other tips & tricks I have learned over the years.