Remove WordPress Default Widgets


/ Published in: PHP
Save to your folder(s)

Removes all but the text widget, look them up: /wp-includes/default-widgets.php.


Copy this code and paste it in your HTML
  1. add_action( 'widgets_init', 'my_unregister_widgets' );
  2. function my_unregister_widgets() {
  3. unregister_widget( 'WP_Widget_Pages' );
  4. unregister_widget( 'WP_Widget_Calendar' );
  5. unregister_widget( 'WP_Widget_Archives' );
  6. unregister_widget( 'WP_Widget_Links' );
  7. unregister_widget( 'WP_Widget_Categories' );
  8. unregister_widget( 'WP_Widget_Recent_Posts' );
  9. unregister_widget( 'WP_Widget_Search' );
  10. unregister_widget( 'WP_Widget_Tag_Cloud' );
  11. unregister_widget( 'WP_Widget_RSS' );
  12. unregister_widget( 'WP_Widget_Meta' );
  13. unregister_widget( 'WP_Widget_Recent_Comments' );
  14. unregister_widget( 'WP_Nav_Menu_Widget' );
  15. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.