How to Display Post Excerpts in Admin by Default?

The names of unchecked boxes in Screen Options for Edit Post screen are stored in user’s meta, per individual user, as an array. Insert the following code in your theme’s functions.php:

function wpse_edit_post_show_excerpt( $user_login, $user ) {
    $unchecked = get_user_meta( $user->ID, 'metaboxhidden_post', true );
    $key = array_search( 'postexcerpt', $unchecked );
    if ( FALSE !== $key ) {
        array_splice( $unchecked, $key, 1 );
        update_user_meta( $user->ID, 'metaboxhidden_post', $unchecked );
    }
}
add_action( 'wp_login', 'wpse_edit_post_show_excerpt', 10, 2 );

This will update user’s meta ( after successful login ) by removing postexcerpt name from the array of unchecked boxes names.

Note: to avoid losing your change, create a child theme and put the code into its functions.php.

Leave a Comment