Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created September 18, 2013 18:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredatch/6613139 to your computer and use it in GitHub Desktop.
Save jaredatch/6613139 to your computer and use it in GitHub Desktop.
Remove default WP widgets
<?php
/**
* Remove default WordPress widgets
*
* @since 1.0.0
*/
function ja_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' );
}
add_action( 'widgets_init', 'ja_remove_default_wp_widgets', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment