How Delete Default Widgets on WordPress

 In Widgets

How Delete Default Widgets on WordPress

In some cases you may need to disabled the default WordPress widgets. The WordPress code snippet below will remove the declared widgets from the 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</h2

Read more about WordPress Widgets API here.

Thank you for seeing my code snippet and fell 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 contact me (here)

Recommended Posts

Start typing and press Enter to search

Let's work together

I'd love to work with you! Please fill out my project form to tell me more about your project/work. I reply to all enquiries within 48 hours.

Availability

  • May - Booked
  • June - Booked
  • July - Limited

Rates

  • My day rate is ÂŁ300.
  • I can provide a fixed price for your work.
  • Projects start at around ÂŁ2,000.

Header Enquiry Form

  • This form collects your name, email address and telephone number 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.