Hiding certain panels in dashboard

@joesk isn’t quite correct. If you simply want to hide a meta box or two on the post-editing screen, you can do that via the Screen Options tab at the top of most screens.

If it’s not aesthetic to your personal preferences and you’d like to remove the ability to edit the Excerpt at all, you have two options:

1) Remove the ‘excerpt’ support from your post type:

/**
 * Remove 'excerpt' support from the 'post' post type.
 */
function wpdocs_remove_posts_excerpt_support() {
    remove_post_type_support( 'post', 'excerpt' );
}
add_action( 'admin_init', 'wpdocs_remove_posts_excerpt_support' );

2) Remove the meta box (retaining post type support):

/**
 * Remove the Excerpt meta box from the 'post' editing screen.
 * 
 * This does not remove the 'excerpt' post type support, simply hides the meta box for all.
 */
function wpdocs_remove_excerpt_meta_box() {
    remove_meta_box( 'postexcerpt', 'post', 'normal' );
}
add_action( 'add_meta_boxes', 'wpdocs_remove_excerpt_meta_box' );

Leave a Comment