"Invalid or duplicated SKU": two products share one SKU
Duplicate SKUs break stock sync, exports and feeds—and WooCommerce only warns you at the moment you save.
The symptom
You try to save a product and WooCommerce refuses: “Invalid or duplicated SKU.” Or worse, nothing refuses, because the duplicate came from an import, a bulk edit or a plugin that never went through the product screen. The catalog looks fine. The stock numbers do not.
What it costs
An SKU is the identifier every system outside WooCommerce uses to mean this exact product. When two products carry the same one:
- Stock sync goes to the wrong product. An ERP, a warehouse app or a marketplace integration updates one row and the customer buys the other.
- Feeds trip over it. Many feed plugins send the SKU to Google Merchant Center or a marketplace as the item ID, and an item ID has to be unique. Two products with one SKU collide, and you are not told which one lost.
- Reporting lies. Any report that groups by SKU adds two products together.
None of this shows up as an error on the storefront, which is why duplicates survive for years.
How to check it yourself
From WP-CLI, without any plugin:
wp db query "SELECT meta_value AS sku, COUNT(*) AS n \
FROM wp_postmeta pm JOIN wp_posts p ON p.ID = pm.post_id \
WHERE pm.meta_key = '_sku' AND pm.meta_value <> '' \
AND p.post_status IN ('publish','draft','private') \
GROUP BY meta_value HAVING n > 1"
Replace wp_ with your table prefix. The query covers variations too, since they carry their own
_sku. A variation with no SKU of its own has no value there and does not appear, even though
WooCommerce shows the parent’s SKU on it. A variation that stores the same SKU as its own parent
does appear; Merchlint leaves that pair out, as explained below.
How to fix it
- Decide which product keeps the SKU—usually the one with order history.
- Give the other a new SKU that follows your own scheme. Don’t leave it blank if anything outside the store uses SKUs.
- If the duplicate is a variation of the same parent, check whether it is a leftover from a deleted attribute value; those are usually safe to remove rather than renumber.
- If an import created it, fix the import. Otherwise the duplicate comes back with the next run.
When it’s a false alarm
- You deliberately reuse SKUs across languages. WPML and Polylang translations of one product legitimately share an SKU. Merchlint excludes known translation pairs; if you use a different multilingual setup, hide the finding.
- A replacement you already published while the original is still live. The finding goes away once you unpublish or delete the old product. Drafts never trigger it: Merchlint compares published products only, while the query above also lists drafts.
- Bundles that inherit a component SKU by design, in some bundle plugins.
How Merchlint finds it
Merchlint reads _sku from published products and from their variations, groups by value,
ignores empty values, and reports each product that shares its code with another product, or with
a variation of a different product. Each of those products gets its own finding with the duplicated
SKU, so the products sharing one code show up as separate rows.
Codes are compared the way a person reads them. From version 0.3.5 an invisible character or a non-breaking space, common when a code is pasted from a spreadsheet, does not make a different code, and spaces at either end are ignored. Upper and lower case are compared the way the store’s database compares them. Before 0.3.5 the result depended on that database: on MySQL 8 such a duplicate was missed, or only one product of the pair was listed.
Two cases stay out, and both on purpose. A product sharing a code with its own variation is not reported: WooCommerce shows the parent’s SKU on a variation that has none, so that pair is how the platform works, not a fault. Nor are two variations sharing a code, of one product or of two, while neither parent product has that code: a finding belongs to a product, and there is nothing to attach it to there. Variations sitting in the trash never count.
Confidence: F—fact from the database. No interpretation, no threshold. Two rows have the same value or they do not.
This check runs in the free version, on every product, with no cap. If SKUs and GTINs are all you need, the same engine also comes as a separate free plugin with just these checks: Duplicate SKU and GTIN Finder.
Doesn't match what you see in your store? Email us—we read every message. contact@merchlint.com