Skip to content

Instantly share code, notes, and snippets.

@wpbandit
Created December 15, 2012 23:42
Show Gist options
  • Save wpbandit/4300979 to your computer and use it in GitHub Desktop.
Save wpbandit/4300979 to your computer and use it in GitHub Desktop.
Action and function to unregister default WordPress widgets.
<?php
// Add Action : Unregister default WordPress widgets
add_action('widgets_init', 'unregister_default_wp_widgets', 1);
// Unregister default WordPress widgets
function unregister_default_wp_widgets() {
unregister_widget('WP_Widget_Archives');
unregister_widget('WP_Widget_Calendar');
unregister_widget('WP_Widget_Categories');
unregister_widget('WP_Widget_Links');
unregister_widget('WP_Widget_Meta');
unregister_widget('WP_Nav_Menu_Widget');
unregister_widget('WP_Widget_Pages');
unregister_widget('WP_Widget_Recent_Comments');
unregister_widget('WP_Widget_Recent_Posts');
unregister_widget('WP_Widget_RSS');
unregister_widget('WP_Widget_Search');
unregister_widget('WP_Widget_Tag_Cloud');
unregister_widget('WP_Widget_Text');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment