Code Snippets

Unregister WordPress Default Widgets

WordPress Code Snippet for Unregistering (disabling) the default widgets. This will clean up the back end admin area of your site.

Use this code in the functions.php file to remove a single WordPress Default Widget.

/** Remove the default WordPress Tag Cloud Widget */
add_action( 'widgets_init', 'unregister_default_tag_cloud_widget' );
function unregister_default_tag_cloud_widget() {
    unregister_widget( 'WP_Widget_Tag_Cloud' );
}

Or, use this code in the functions.php file to unregister/remove multiple WordPress Default Widgets.

/** Unregister WordPress Default widgets */
function remove_dashboard_meta() {
        remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
        remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
        remove_meta_box( 'dashboard_primary', 'dashboard', 'normal' );
        remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );
        remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
        remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );
        remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
        remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
        remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');//since 3.8
}
add_action( 'admin_init', 'remove_dashboard_meta' );
}
remove_action( 'welcome_panel', 'wp_welcome_panel' );
function remove_akismet_widget() {
        unregister_widget( 'Akismet_Widget' );
}
add_action( 'widgets_init', 'remove_akismet_widget', 11 );

Hire a WordPress Expert

Get hourly and project based theme customization, theme tweaks, and development help from an experienced Kelowna WordPress developer.  We’ve been building WordPress websites full-time for over a decade. We can help you.