← Back to All Snippets

Add Featured Image Thumbnail Column to Admin Posts List

⚡ Target: functions.php 🔒 Tested: WP 6.6+ / PHP 8.2+ 💻 Lang: PHP
PHP (functions.php)
add_filter( 'manage_posts_columns', function( $cols ) {
    $cols['featured_thumb'] = __( 'Thumbnail', 'textdomain' );
    return $cols;
} );

add_action( 'manage_posts_custom_column', function( $col, $post_id ) {
    if ( 'featured_thumb' === $col ) {
        echo get_the_post_thumbnail( $post_id, [50, 50] ) ?: '—';
    }
}, 10, 2 );

Save time when managing large blogs by previewing featured image thumbnails directly in the WordPress posts list table.

← Back to All Snippets Explore Dev Tools →