Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon How do I set the featured image when importing multiple images


How do I set the featured image when importing multiple images


To set the featured image when importing multiple images for a WooCommerce product, follow these guidelines:

1. In your CSV file:
- List all image URLs or filenames in the "Images" column, separated by pipe symbols (|).
- The first image in this list will automatically be set as the featured image (also known as the main product image).

For example:


featured-image.jpg|gallery-image1.jpg|gallery-image2.jpg

2. During import:
- WooCommerce will recognize this format and automatically set the first image as the featured image.
- Subsequent images will be added to the product gallery.

3. If using WP All Import or a similar plugin:
- There's usually an option like "Set the first image to the Featured Image (_thumbnail_id)" in the image import settings.
- Ensure this option is checked.

4. For existing products:
- The first image in the list will replace the current featured image if one exists.
- If you want to keep the existing featured image and only add to the gallery, you may need to use a custom import script or modify your import plugin settings.

5. Verify after import:
- Check a few products to ensure the featured image is set correctly.
- The featured image should appear as the main product image on both the shop page and the individual product page.

Remember, the order of images in your CSV "Images" column is crucial - always put the desired featured image URL or filename first in the list. If you're using a custom import script, you can also explicitly set the featured image using the `set_image_id()` function for the WooCommerce product object.

Citations:
[1] https://woocommerce.com/document/import-woocommerce-product-images/
[2] https://stackoverflow.com/questions/43521429/add-multiple-images-to-woocommerce-product
[3] https://wordpress.org/support/topic/multiple-images-for-variations-of-my-products/
[4] https://www.cozmoslabs.com/1350802-import-woocommerce-products-with-images/
[5] https://www.wpallimport.com/documentation/import-woocommerce-products-with-images/