How to remove all the default WordPress widgets

If you are not using any of the default WordPress widgets, if you want your pages to load just a bit faster or you are just like me and want to clean up your widget administration area. Well here is how to remove all the default WordPress widgets.

Add the following code to your theme’s functions.php file. If you want to keep one or two widgets just comment it out (add “//” at the beginning ) or delete the line that has the widget that you want to keep.

function remove_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');
unregister_widget('BBP_Login_Widget');
unregister_widget('BBP_Views_Widget');
unregister_widget('BBP_Forums_Widget');
unregister_widget('BBP_Replies_Widget');
}add_action( 'widgets_init', 'remove_default_WP_widgets' );