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