Repeated gallery images in WooCommerce products

A product gallery that shows the same photo twice — or repeats the featured image as its first thumbnail — reads as an unfinished page. CatalogLift finds every product whose gallery repeats an image and removes the extra copy with one approved click.

Images & media Medium severity Fix in CatalogLift

The gallery is where a shopper looks for the angle the featured photo did not show: the back, the label, the item in use. Every slot that repeats a photo they have already seen is a slot that does not answer a question — and on a phone, where thumbnails are scarce, it pushes a real angle out of view.

  • It looks like a mistake. Two identical thumbnails in a row are the visual equivalent of a typo in the title; the shopper notices, and trust drops a notch before they read the price.
  • The featured image counts twice. WooCommerce already puts the featured image first on the product page. When the same attachment also sits in _product_image_gallery, most themes render it a second time as the very next slide.
  • Imports multiply it. CSV imports and feed syncs often append gallery IDs instead of replacing them, so one repeat after the first import becomes three after the third.
  • Feeds and lightboxes carry it along. The repeated attachment goes out in product feeds and shows up as a duplicate frame in every zoom and slider that reads the gallery.

The gallery is stored as a comma-separated list of attachment IDs in _product_image_gallery, and the featured image as a single ID in _thumbnail_id. The most common repeat — the featured image also listed in the gallery — is one WP-CLI query away:

wp db query "SELECT p.ID, p.post_title, t.meta_value AS thumbnail_id, g.meta_value AS gallery
FROM wp_posts p
JOIN wp_postmeta t ON t.post_id = p.ID AND t.meta_key = '_thumbnail_id'
JOIN wp_postmeta g ON g.post_id = p.ID AND g.meta_key = '_product_image_gallery'
WHERE p.post_type = 'product' AND p.post_status = 'publish'
  AND FIND_IN_SET(t.meta_value, g.meta_value) > 0
ORDER BY p.ID;"

Adjust the table prefix if yours isn't wp_. Variations store their own _thumbnail_id under post_type = 'product_variation'.

The other case — the same ID appearing twice inside the gallery list itself — is awkward in plain SQL, because the list is one string. You end up exporting the meta and checking each list in a script, or opening products one by one. And either way the answer is a snapshot: the next import that appends gallery IDs recreates the repeat, and nobody is watching for it.

How CatalogLift finds and fixes it

Every scan looks at the synced media assignments of each current product, both the featured image and the gallery, and groups them by attachment. A product is flagged when one attachment is assigned to it more than once and at least one of those assignments is in the gallery. A featured image with no gallery copy is fine; two visually similar but separate files are not the same attachment and are not flagged. Each finding is raised at medium severity and carries the attachment, its URL, how many times it is used, and the role and position of each use as evidence.

There is no AI on this check — the fix is a deterministic edit to the gallery. CatalogLift computes the gallery without the repeat: a regular gallery image keeps its first copy, and a featured image loses every gallery copy because it already leads the page. You see the before and after list of attachments in CatalogLift and approve. Nothing is written before that decision; on it, the gallery goes to WooCommerce, and if the gallery changed in the meantime the apply refuses rather than overwriting it. The next scan verifies the repeat is gone, and because CatalogLift keeps watching, an import that appends the same IDs again becomes a fresh finding instead of a quiet regression.

Fair questions, straight answers.

What counts as a repeated gallery image?

The same media attachment assigned to one product more than once, with at least one of those assignments in the product gallery. That covers a gallery that lists the same image twice and a gallery that repeats the featured image. Two different files that happen to look alike are not flagged — the check compares the attachment, not the pixels.

Is a featured image repeated in the gallery really a problem?

On most themes, yes. WooCommerce already shows the featured image as the first slide, so listing it in the gallery as well makes shoppers see the same photo twice in a row and hides a real angle further down the strip.

Does CatalogLift use AI to fix this?

No. The fix is deterministic: CatalogLift computes the gallery without the repeat, shows you the before/after list of attachments, and after you approve, applies it to WooCommerce and confirms it on the next scan. Nothing changes in your store except on your authority.

Which copy is removed?

If the repeated image is a regular gallery image, the first occurrence stays and later copies are removed. If it is the featured image, every gallery copy is removed, because the featured image already leads the product page. Other gallery images keep their order.

See it on your own catalog.

Create a free account, connect your WooCommerce store and this check runs on your real products, along with the rest.

No card required. The free plan never writes to WooCommerce.