Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove default widgets from the WordPress backend. Source: http://www.paulund.co.uk/how-to-remove-default-wordpress-widgets
<?php
//* Remove default widgets from the WordPress backend
add_action('widgets_init', 'customprefix_remove_default_widgets', 11);
function customprefix_remove_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');
// since WordPress version 4.8
unregister_widget('WP_Widget_Media_Image');
unregister_widget('WP_Widget_Media_Audio');
unregister_widget('WP_Widget_Media_Video');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.