Speedbit
Speedbit

Reputation: 69

WooCommerce: how to change featured (main) image of product, choosing (only) from product gallery images?

I have imported my products from a CSV and then, I wanted to change some of the "featured" product image, choosing then from those that were uploaded just at the product images gallery ... and I find that it is not possible (!?)

For example, for some product, an image of the product seen from the back, was uploaded as the main image (the first listed in the CSV) ... while I have in the gallery of the product, an image of it, seen from the front.

Of course, I can change the featured image, by choosing (finding it, at first!) among the 4600+ images that I have uploaded to my media gallery ... but it's not reasonable, when I have to do this on 50+ products!

I SIMPLY need to edit the product and modify the featured image, choosing it from one of the images in the product gallery ... click and "set it as main image" (?)

I think it's not a very crazy option ... and in fact, it seems so basic and stupid to me, that I can't imagine it not being considered in WooCommerce! So, I think it's just me, who can't find the option ... a way to do it!

Any idea to guide me? Thanks in advance!

Upvotes: 0

Views: 1552

Answers (1)

Vincenzo Di Gaetano
Vincenzo Di Gaetano

Reputation: 4110

The only (faster) way is to re-import a .csv file with the "Images" field valued as the following file:

As you have already said, the first image is imported as a featured image and the others as product thumbnails (product gallery).

The first image is certainly imported as a featured image.

If not for you, make sure the url and image file name are correct.

When you have to manage so many images you need to be organized.

I don't know how you handled the filenames but assuming you have 4 images for each product (where the first is the featured image) you could use the product SKU as the image identifier.
So if the SKU was H451P the image file names will be:

  • H451P.jpg - (featured image)
  • H451P-1.jpg - (first image gallery)
  • H451P-2.jpg - (second image gallery)
  • H451P-3.jpg - (third image gallery)

If the directory of your uploaded files is /wp-content/uploads/2021/03/ then the filenames will be:

  • https://yourdomain.com/wp-content/uploads/2021/03/H451P.jpg - (featured image)
  • https://yourdomain.com/wp-content/uploads/2021/03/H451P-1.jpg - (first image gallery)
  • https://yourdomain.com/wp-content/uploads/2021/03/H451P-2.jpg - (second image gallery)
  • https://yourdomain.com/wp-content/uploads/2021/03/H451P-3.jpg - (third image gallery)

This will save you a lot of time and can import your product images automatically (this approach assumes you want to add the same amount of images for each product).

Note that if you set a wrong url, the creation or update of the product will be skipped.

This work will waste you a lot of time at the beginning but surely the image management will be more efficient in the future.

Keep in mind that you can also manage images with any plugin available but you will always have to specify which image to set as featured and which as product gallery.

Only a good file organization can save you.

Upvotes: 1

Related Questions