Remove Unwanted Metaboxes or widgets in Admin Panel

In WordPress admin area by default, many meta widgets are present. But  if you are running a multi-user site then every user is not familiar with WordPress. So you don’t want to show those widgets to your users. By removing these widgets, you can make your user’s dashboard more simple.

By default, there are 4 widgets in the admin panel.

1. At a glance

2. Activity

3. Quick Draft

4. WordPress News

4

If you want to remove these widgets from user’s admin panel add the following code below to your function.php file and make your user’s dashboard more simple for him.

// remove unwanted dashboard widgets for relevant users
function wpsmallenvelop_remove_dashboard_widgets() {
    $user = wp_get_current_user();
    if ( ! $user->has_cap( 'manage_options' ) ) {
remove_meta_box( 'dashboard_right_now', 'dashboard', 'side' );
 remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' );
 remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
 remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
 }
}
add_action( 'wp_dashboard_setup', 'wpsmallenvelop_remove_dashboard_widgets' );

1

1 thought on “Remove Unwanted Metaboxes or widgets in Admin Panel”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.