How Delete Default Widgets on WordPress

In some cases, you may need to disable the default WordPress widgets. The WordPress code snippet below will remove the declared widgets from the WordPress widgets area.

Adjust and add the code below on your WordPress theme’s functions.php file.

 
function ns_unregister_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 ' ); 
 unregister_widget( ' Twenty_Eleven_Ephemera_Widget ' ); 
} 
add_action( 'widgets_init', 'ns_unregister_default_widgets', 11) ; 

 

How Delete Default Widgets on WordPress

Read more about WordPress Widgets API her.

Thank you for seeing my code snippet and feel free to share and comment :).Do you have any interesting changes to your “widget area” that you make or some other cool code snippets that you’d like to share? Let everyone know in the comments what cool tricks you’ve come up with or you can let me know by contacting me (here)

 

ABOUT AUTHOR

Nuno

I am a Freelance Web Developer and WordPress Expert based in London with a wealth of website development and support experience. I am great at problem solving and developing quick solutions.

  • LET'S TALK!

    Fill in the form below to make an enquiry or find my contact details on my contact page.

  • This form collects your name and email address so that I can respond to the enquiry(ies) that you submit via this website. Please check my privacy policy for the full story on how I use, protect and manage your submitted data.