Photos onto WooCommerce products by SKU
Flying Pigs Pro can put your photos straight onto your WooCommerce products as they upload. Name each photo after its product's SKU, switch on one option, and drop the photos. Each one joins its product the moment it lands: the product image first, then the gallery in order. There is no image list to write and no second import.
Flying Pigs follows the file naming in WooCommerce.com's guide to bulk product images, so photos named that way attach as they are.
1. Create the products first
The SKU is looked up as each photo arrives, so the products must exist before you upload. The easiest way: import your products with WooCommerce's CSV importer, with a SKU on every product and no image column at all. They will show the grey placeholder until the photos land.
2. Name the photos after their SKUs
TSHIRT-001.jpg or TSHIRT-001.0.jpg | the product image of SKU TSHIRT-001 |
TSHIRT-001.1.jpg, TSHIRT-001.2.jpg … | its gallery, in that order |
TSHIRT-001-1.jpg, TSHIRT-001-2.jpg … | also its gallery (the dash style) |
- The number can follow a dot, a dash, an underscore or a space, or sit in brackets:
TSHIRT-001 (2).jpg. Numbers up to 999 work. - The whole file name is always tried as a SKU first, so SKUs that end in a number, or contain a dot, match as they are.
- Upper and lower case do not matter:
tshirt-001.jpgfinds TSHIRT-001. - JPEG, PNG, WebP and the other image types all work the same way.
3. Switch on the option and upload
- On Media > Flying Pigs Uploader, switch on Attach to WooCommerce products by SKU in the run options. The option shows only while WooCommerce is active.
- If you use a folder plugin, pick the folder the photos should go in.
- Drop the photos, or a whole folder of them, and press Start upload.
The option stays on for your later runs until you switch it off. It is saved with your WordPress user.
What you see
- Each row in the file list says what its photo was attached to, for example Product TSHIRT-001: product image or gallery.
- The summary card counts it up: WooCommerce: 558 photos attached to 93 products by SKU. 0 had no product with a matching SKU.
- In the Media Library, each photo shows its product under "Uploaded to", the way WooCommerce's own editor leaves it.
Variations
Name a photo after a variation's SKU and it becomes that variation's image. A variation has one image, so give each variation one photo.
Products that already have photos
- A photo named for the product image (
TSHIRT-001.jpg,TSHIRT-001.0.jpgorTSHIRT-001-1.jpg) becomes the product image. The image that was there moves to the front of the gallery, so nothing is lost. - Numbered photos join the gallery in their order. Pictures that were already in the gallery stay, after the new ones.
- Uploading the same photos again with Overwrite existing files on replaces them in place and changes nothing on the product. Without Overwrite, they are added again as new photos.
Photos with no matching product
A photo whose name matches no SKU still uploads to the Media Library as normal. Its row says no product with SKU …, and the summary card counts it. Check the name against the product's SKU, or attach it to the product by hand.
Good to know
- WebP only (Pro, on by default) stores the photos as
.webp. That changes nothing here, since the SKU match ignores the extension. If you ever list images in a product CSV, name them.webp. - To change photos later, for a sale banner or a better picture, re-upload the same names with Overwrite existing files on. They are replaced in place, and the products keep showing them. See Using the watermark maker for a sale mark on and off again.
- The WordPress way, uploading on the Media page and then filling an image column in a second import, still works. Flying Pigs does both jobs in one pass.