Add Featured Image Column in WordPress Admin
Home » WordPress » How to Add Featured Image Column in WordPress Admin

How to Add Featured Image Column in WordPress Admin

How to Add Featured Image Column in WordPress Admin – Adding a featured image column to the WordPress admin post list can greatly enhance the usability and visual appeal of your content management interface, making it easier for you and your team to quickly identify posts by their images.

This can be particularly useful for sites with a large volume of content or those that rely heavily on visual elements.

The default WordPress posts list in the admin area provides information like the title, author, categories, tags, and dates, but it does not show the featured image. Adding this visually aids in content management and can speed up the editorial process.

There are two primary methods to add a featured image column to the posts list: using a plugin for a user-friendly approach or adding custom code to achieve a more tailored solution.

Using a Plugin

Plugins offer a straightforward way to enhance the admin interface without diving into code. Plugins like “Admin Columns” allow you to customize the columns in the WordPress admin area, including adding a featured image column.

Steps to use a plugin:

  1. Go to Plugins > Add New in your WordPress admin dashboard.
  2. Search for “Admin Columns.”
  3. Install and activate the plugin.
  4. Navigate to the plugin’s settings via Settings > Admin Columns.
  5. Choose the “Posts” type and add a new column for the featured image.
  6. Configure the settings for display and save your changes.

This method is best for users who prefer not to modify their site’s code and need an easy reversible option.

For those who prefer a code-based solution or want to avoid using additional plugins, adding custom code to your WordPress site is an effective method.

Also read: How to Create an AI Featured Image Generator WordPress Plugin

You can add this code directly to your theme’s functions.php file or, preferably, to a WordPress child theme to ensure that your changes are not overwritten during theme updates.

Alternatively, using a site-specific plugin for custom code is a safe and efficient way to manage these customizations.

Option 1: Using the Child Theme’s functions.php File

Insert the following code to add a featured image column:

function zerobytecode_add_featured_image_column($columns) {
    $new_columns = array();
    foreach($columns as $key => $title) {
        if ($key=='title') // Put the featured image column before the title column
            $new_columns['featured_image'] = __('Featured Image');
        $new_columns[$key] = $title;
    }
    return $new_columns;
}
add_filter('manage_posts_columns', 'zerobytecode_add_featured_image_column');

function zerobytecode_display_featured_image_column($column, $post_id) {
    if ($column == 'featured_image') {
        echo get_the_post_thumbnail($post_id, 'thumbnail');
    }
}
add_action('manage_posts_custom_column', 'zerobytecode_display_featured_image_column', 10, 2);
Option 2: Using a Site-Specific Plugin for Custom Code Snippets
  1. Install the “Code Snippets” plugin from the WordPress plugin repository.
  2. Activate the plugin and go to Snippets > Add New.
  3. Paste the same code snippet provided above into the new snippet area.
  4. Name your snippet (e.g., “Add Featured Image Column“), save it, and activate it.

That’s it. Check your post list, there should be a new column for featured image.

Wrapping Up

Adding a featured image column to your WordPress admin posts list can significantly improve your content management workflow.

Whether you choose a plugin or a custom code approach, this enhancement helps you visually manage your site’s content more effectively.

Each method has its benefits, allowing you to choose based on your comfort with WordPress backend customization.

Similar Posts