v11.2 causes issues with the product image gallery
-
v11.2 causes issues with the product image gallery.
After applying the update, the primary image for the default product variation has been removed from the gallery. If there were 2 images, the 2nd image becomes primary, if there was only 1 image, then there is no primary image. This is true for every product. In addition it randomly inserts an unrelated product image into the gallery as well, it seems like the same image, into multiple products, and not the default variation, at least I can see no pattern with the 2nd issue.
I had to restore my site from backup, since a rollback didn’t fix the issue it caused with the gallery.
We use the Additional Variation Images Gallery for WooCommerce By Emran Ahmed along side WooCommerce
-
Hi @bklogos !
Thank you for taking time to raise this issue and describe the problem.
> After applying the update, the primary image for the default product variation has been removed from the gallery. If there were 2 images, the 2nd image becomes primary, if there was only 1 image, then there is no primary image.
I believe the behaviour you describe could be related to the migration implemented in this PR https://github.com/woocommerce/woocommerce/pull/68389 and released in 10.2. It’s meant to fix another issue that might’ve happened in the product galleries.
Can you confirm if you mean the frontend behaviour or you spotted that in product editor (admin site)? Because the removal in product editor was intended to fix potentially broken data, while if that’s been spotted in the frontend, we need to verify it further.
> This is true for every product.
Also, the primary variation primary should’ve been removed only when it’s exactly the same as parent featured image. Could you confirm that was a case in this scenario?
> In addition it randomly inserts an unrelated product image into the gallery as well, it seems like the same image, into multiple products, and not the default variation, at least I can see no pattern with the 2nd issue.
Can you share more details what do you see, for example are these images from parent image? Or maybe they’re duplicated? Since WooCommerce 11.1, we introduced variation image galleries feature in core which adjusts how the product galleries work. I’m wondering whether plugin you use could conflict with the core feature.
Also could you share:
- What WooCommerce version did you update from? Was it 11.1 or earlier?
- Did you by any chance use WooCommerce Additional Variation Images plugin in the past? (This was official and paid WooCommerce plugin).
I’m sorry for the inconvenience, we’ll look into it more once we get more details, thank you!
Hi @karolmanijak,
I replied by email, so I’m not sure if it was received or not.
*Can you confirm if you mean the frontend behaviour or you spotted that in product editor (admin site)?* Because the removal in product editor was intended to fix potentially broken data, while if that’s been spotted in the frontend, we need to verify it further.
Yes, I’m aware of the migration process, it had been applied prior to the update of v11.2 Unfortunately for me, I didn’t spot the issue on my staging site, only noticed when working on production after update was applied :-(I noticed it first working in Admin Columns variation table, I have it setup to show thumbs of the variation images, and i noticed the 1st column’s image missing, and the 2nd column’s there.Then I checked inside the product variation editor, and realized that the defaulted variation now had image 2 as primary, and image 1 was missing.And yes, we always have the product default image set to the primary image of the default variation.Then I checked the frontend, the gallery flashes image 1 on load, then displays image 2 for the default variation ( image 1 is not available )And after I restored the production site by backup, I spun up another clone last night, I ran the migration tool, then tried the WC v11.2 upgrade again, same results.
Also, the primary variation primary should’ve been removed only when it’s exactly the same as parent featured image. *Could you confirm that was a case in this scenario?*
Yes, as mentioned above, but it shouldn’t be removing it at all IMHO.
Can you share more details what do you see, for example are these images from parent image? Or maybe they’re duplicated? Since WooCommerce 11.1, we introduced variation image galleries feature in core (<span class=”Apple-converted-space”> </span>https://developer.woocommerce.com/2026/09/03/wc-11-1-release-notes/#h-introducing-variation-image-galleries<span class=”Apple-converted-space”> </span>) which adjusts how the product galleries work. I’m wondering whether plugin you use could conflict with the core feature.
I just spun up another staging this morning and applied v11.2, I noticed now that the issue keys on the color attribute, that is to say, if 2 variations share the same color as the defaulted variation, both are missing image 1 ( the primary ).I previously misunderstood what happened when a default variation now contained no images in its gallery, I assumed it would display a blank, it doesn’t, it displays the product’s primary image.It took a while to find one that had an errant image, it seems random, the example is SC209_OBH, and the random image is not in that SC209 grouping, in browser tools tells me it is SC201 BGD 02. If I then open manage gallery, and search SC201, there is no checkmark next to SC201 BGD 02. It does show in the gallery thumbs on the frontside.I found another within the SC210_EDG variation, the errant there is SC202 RDA 02Neither SC209_OBH or SC210_EDG are default variation for their respective products, it is such an odd bug.
What WooCommerce version did you update from? Was it 11.1 or earlier?
Version 11.1.2
Did you by any chance use WooCommerce Additional Variation Images plugin in the past? (This was official and paid WooCommerce plugin).
No, we only use the Additional Variation Images Gallery for WooCommerce By Emran Ahmed ( v1.41 ), and had no issues prior to v11.2 update
Hey @bklogos
Thanks for digging into this so thoroughly. The color-attribute pattern, the primary-image removal on the default variation, and the stray images showing on the front end without a matching checkmark in Manage Gallery are all really useful details. I’ve passed your full reproduction to the team already looking into this so they can pick it up from where the thread left off. Keeping an eye on this topic is the best place to catch their follow-up.
There was an update for Additional Variation Images Gallery for WooCommerce, By Emran Ahmed posted today, so I thought I would run some more tests. I’ve come to the conclusion that for the issue of “stray images”, I think we can lay that at the foot of that plugin’s migration tool. I spun up a clone today, applied the update, then ran their migration tool for the hell of it, and I found errant images added to a group of records. Then I started from a fresh clone again and installed WC v11.2.1, and no errant images, HOWEVER the issue of the missing primary image, for the default variation is still applicable, so that on WC. It is physically removing those image urls from the images field.
Looking at the dataset, there are now 2 image fields, “images” and “Woo Variation Gallery Images”. The images field is where the gallery pulls the images for display on the product page. What is the purpose of Woo Variation Gallery Images field? Note: it appears to be only populated with the secondary image urls, and oddly their are a few cases where variations had multiple images, but the field is empty.
Best, Brian
Hi @bklogos
Testing the plugin’s migration tool and WooCommerce 11.2.1 on separate fresh clones is what split this into two problems, and you read both of them right.
The missing main image is on our side. The 11.2.0 database update removes a variation’s own image when it’s the same image as the parent product’s main image. It was meant to clear images an older version saved onto variations by mistake, but it can’t tell those apart from images you picked on purpose.
It hits every variation that used the parent’s image, not only the default one. A variation with more images then opens on its second one.
The update runs once per store. Your restored backup is from before 11.2, so it will run again when you update the live site. Update first, then put the images back. It won’t run a second time after that.
To bring them all back at once, use that pre-update backup. Each variation keeps its image as
_thumbnail_id, and the update deleted those rows, so adding them back for your variations from the backup restores every image.For a few variations, you can do it in the editor instead:
- Open the product and go to Product data > Variations.
- Open the variation and click Manage next to the Variation gallery.
- Add the missing image, then drag it to the front. The first image is used as the primary.
- Click Save changes.
If dragging doesn’t move it, remove the other images and add them back after it.
The stray images only showed up after you ran the plugin’s migration tool, not on your clean 11.2.1 clone, so that part is worth raising with the Additional Variation Images Gallery plugin’s author. The Woo Variation Gallery Images field comes from that plugin too, not from WooCommerce. Their support forum is the best place to ask about both.
Hi @shameemreza,
We have almost 2000 so manually is not an option ;-). I spun up a clone, ran an export of all variations, id, sku & images… and then imported it back after applying the WC update, that seems to work ok.
I have reported the stray image incident to Additional Variation Images Gallery plugin’s author. I have no reason to use their migration command again, so hopefully it is a moot issue for me at least going forward.
Regards, Brian
Hi @bklogos,
Thank you for all the testing you did
I checked with the development team about the missing primary image. It comes from a one-time cleanup that runs during the WooCommerce 11.2 database update (#68389). The cleanup removes a variation’s main image when it’s the same as the parent product’s main image. It was built to fix variations where that image had been saved by mistake. But it can’t tell those apart from images set on purpose, like your default variations.
I want to be honest with you about the timeline. This cleanup is staying as part of the 11.2 update, and there is no release planned that changes it. So on 11.2.1 and on future versions, you will see the same result on your default variations. The team is working on a follow-up to make variation galleries behave more predictably (#70104), but it doesn’t stop this cleanup, and it doesn’t have a release date yet.
I know this isn’t the answer you were hoping for. Your report, especially the color attribute pattern, has been shared with the team and is part of their discussion. If anything changes, we’ll update this thread.
About your other question: since WooCommerce 11.1, a variation’s main image and its gallery are stored separately. The gallery only holds the extra images, which is why that field shows the secondary images and not the primary one. And you’re right about the stray images. Those come from the Additional Variation Images Gallery migration tool, so the plugin author is the best person to look at that part.
Hi @bklogos,
Good to hear the export and import from your pre-update clone worked for your variation images.
For anyone else who finds this after the 11.2 update, a backup from before the update is the closest way back. Export the variation images from a copy restored from that backup, then import them on the updated site, so the update doesn’t remove them again. Any image changes made after the backup get overwritten.
Be careful with database queries that copy the parent’s featured image onto variations. The update didn’t record which variations lost their image, so a query like that also adds the image to variations that never had one of their own.
You must be logged in to reply to this topic.