Back to blog
4 min read Import Guides

Set Featured Images in Bulk from a CSV File

Setting a featured image means opening the post, clicking Set featured image, finding the photo and saving. For four posts that’s fine; for a whole archive after a redesign, or for posts imported without images, it’s an afternoon. With Import Export by RockStarLab, a CSV file with the post ID and an image URL sets them all at once. In the example, four posts on a coffee roastery’s blog get new featured images from the Media Library.

Free: everything in this guide works for posts and pages. PRO: the same for custom post types and WooCommerce products.

Short Answer

  1. Make a CSV with the columns ID and featured_image_url: one row per post, with the URL of the image.
  2. In Import, choose Posts, upload the file and click Auto Map.
  3. Set Check for Existing Items by Field to ID, If Match Found to Update and If No Match Found to Skip, and start the import.

Find the posts and their IDs

Export the posts you want to change with ID and Title, and Featured Image URL to see what they have now. To list only posts without a featured image, add the filter Custom Field (Meta) _thumbnail_id Is Empty; WordPress stores the featured image’s ID in that field. See exporting posts with their featured image URL for the export.

Add the image URLs

For images already in the Media Library, copy the File URL from the attachment details (Media → Library → click the image). Our file, with a title column added only to keep track:

ID,post_title,featured_image_url
1854,Our New Roastery Opens in March,https://www.example-roastery.com/wp-content/uploads/2026/11/roastery-front.jpg
1857,Meet the Team Behind the Beans,https://www.example-roastery.com/wp-content/uploads/2026/11/team-photo.jpg
1861,Five Single-Origin Coffees to Try This Winter,https://www.example-roastery.com/wp-content/uploads/2026/11/colombia-huila.jpg
1863,How We Source Green Coffee,https://www.example-roastery.com/wp-content/uploads/2026/11/cupping-session.jpg

The URL can point to the full-size file; you don’t need a particular size such as 300×200.

Import by ID

In Import, choose Posts, upload the CSV and click Auto Map. ID, post_title and featured_image_url are mapped:

Import mapping: ID, post_title and featured_image_url mapped to ID, post_title and featured_image_url; 3 of 3 fields mapped
Auto Map recognises the ID and featured_image_url columns.

To change only the image, you can remove the post_title mapping with the × button; we left it because the titles in the file were the same as on the site. On the options step, update by ID and skip rows without a match:

Import options: Check for Existing Items by Field ID, If Match Found Update, If No Match Found Skip, Automatically Import Media Files on, If Media File Already Exists Skip
Update by ID, and reuse images that are already in the Media Library.

With If Media File Already Exists set to Skip, the import uses the image that is already in the Media Library instead of adding a copy.

Import Completed Successfully: 4 successful, 4 updated, 0 created, 0 skipped, 0 failed
Four posts updated with their new featured images.

All four posts got their new featured image, including “Five Single-Origin Coffees to Try This Winter”, which switched to a different photo. The Media Library still had the same number of files after the import: no duplicates.

Before you import

An import by ID changes the posts in the file and nothing else. Check the IDs once more, try one row first, and back up the site before importing hundreds of rows.

With an AI agent

An AI agent connected through the WordPress MCP Adapter (see connecting Claude Code to WordPress) can check the result:

Show the featured image of every post published in October 2026.

In our run after the import, the agent called rsl-ie/export-preview with two Date filters for October and the fields ID, Title and Featured Image URL. It returned the four posts with the new images: roastery-front.jpg, team-photo.jpg, colombia-huila.jpg and cupping-session.jpg.

FAQ

Can I use images that aren’t in the Media Library yet?

Yes, with a public URL and Automatically Import Media Files turned on, the image is downloaded during the import. For many new images, upload them first; see importing images from URLs.

Does this change anything else in the posts?

The import writes the columns you map. Remove the title mapping if you don’t want titles touched.

Export posts with the filter Custom Field (Meta) _thumbnail_id Is Empty. In our run, after removing one image again, that export returned just that one post.

Can I set images for pages or products?

Pages, yes, the same way with Pages. Products and custom post types need PRO.

Get the free plugin on WordPress.org.

Dmitriy
About author

Dmitriy

WordPress Developer with 15+ years of commercial experience. Elite Author on ThemeForest and creator of custom WordPress plugins. Passionate about clean code, performance optimization, and building useful tools for the WordPress community.

JOIN THE CONVERSATION

Comments 0

Have a question or a tip to share? Leave it below.

Leave a comment

Your email address will not be published. Required fields are marked *

We store your name, email and comment to show and moderate it; your email is never published. Spam protection is provided by Cloudflare Turnstile and profile pictures by Gravatar. See our Privacy Policy.


Try the plugin with no risks!

New users get 1 month with access to all premium features. Experience the most powerful WordPress data engine today.

Download Now
Get PRO for FREE