How to Find and Fix Duplicate SKUs in WooCommerce
WooCommerce requires every SKU to be unique across all products and variations, and it rejects a save with “Invalid or duplicated SKU.” when a SKU is already taken. Duplicates still get in through imports, migrations and direct database writes; the quickest way to find them is a dry run of your CSV before import plus a read-only audit of the products already in your store, both of which the free Catalogafe plugin does without changing a single product.
This guide covers what WooCommerce actually checks, why duplicates appear anyway, what they break, and how to find and fix them in a spreadsheet and in a live catalog. Every WooCommerce and Catalogafe behaviour described here was read from the plugin code, not guessed.
What a SKU is and why duplicates break things
A SKU (stock keeping unit) is the code you give a product or variation so your store, your warehouse and your suppliers all mean the same item. In WooCommerce it lives in the Inventory tab of the product editor, and each variation of a variable product has its own SKU field.
WooCommerce treats the SKU as an identifier, so it enforces uniqueness. When a product is saved with a non-empty SKU, WooCommerce checks whether any other product or variation already uses it. The check:
- covers both
productandproduct_variationrows, so a variation and a simple product cannot share a SKU; - ignores products in the trash, so a trashed product’s SKU is free to reuse, and the clash comes back if you restore it;
- runs against the
wc_product_meta_lookuptable, not the product’s own meta.
If the check fails, the save is refused with the error “Invalid or duplicated SKU.” (error code product_invalid_sku). The same message comes back through the REST API and inside the product CSV importer. GTIN, UPC, EAN and ISBN values get the same treatment since WooCommerce 9.1, with the message “Invalid or duplicated GTIN, UPC, EAN or ISBN.”
How duplicates get in despite the check
The check only runs when WooCommerce itself sets the SKU through its product object. Anything that writes around that path can create a duplicate:
- Direct meta or SQL writes. A migration script, a sync tool or a developer calling
update_post_meta( $id, '_sku', ... )never touches the uniqueness check. (Catalogafe’s own test suite creates its duplicate-SKU fixture exactly this way.) - Plugins that override the check. WooCommerce exposes a filter,
wc_product_pre_has_unique_sku, that lets a plugin declare any SKU unique. A marketplace or multi-vendor plugin that uses it can allow duplicates on purpose. - Trash and restore. Trashed products don’t count. Create a replacement with the same SKU, restore the original later, and you have two live products on one SKU.
- Imports with “Update existing products” on. The importer matches rows to products by ID or SKU. A row with an ID that points at product A and a SKU that belongs to product B is asking WooCommerce to move B’s SKU onto A; WooCommerce refuses it with the duplicated-SKU error, but the row fails after everything before it has already been written.
- Duplicates inside the file. The importer processes rows in order. If the same SKU appears on two rows, the first row creates the product and the second row is treated as an existing product: skipped with “A product with this SKU already exists.” when update mode is off, or silently overwriting the first row when it is on.
What breaks
- Inventory. Two products on one SKU means two stock counts for one physical item. A warehouse feed, a POS or a marketplace sync that keys on SKU will update whichever one it finds first.
- Imports. Every later CSV import that matches by SKU hits the same ambiguity. Rows get skipped, or update the wrong product, and the import log shows only the row number, not which product it collided with.
- Reporting and feeds. Sales and stock reports grouped by SKU merge two products into one line. Google Merchant Center and marketplace feeds that require unique identifiers reject or deduplicate the items on their side.
- Editing. Once duplicates exist, opening either product and clicking Update can fail with “Invalid or duplicated SKU.” even though you didn’t touch the SKU field, because the save re-runs the check.
Find duplicate SKUs in a CSV before you import
If the duplicates are in a spreadsheet you are about to import, catch them there. You can do it by hand or with a dry run.
By hand in a spreadsheet
Sort the SKU column and scan for neighbours that match, or use conditional formatting to highlight duplicate values in the SKU column. Both work for a short file. Neither tells you which SKUs already exist in your store, and neither checks the GTIN column or the ID column, which have the same uniqueness rule.
With a Catalogafe dry run
Catalogafe reads your CSV and predicts what the WooCommerce importer would do with it, without importing anything. Install it, then go to Products → CSV Dry Run.
Here it is in 87 seconds, duplicate SKUs included:

- Choose the CSV (or TXT) file. Files up to 16 MB and 10,000 product rows are accepted.
- Leave Delimiter on Auto detect unless you know the file uses a semicolon, tab or pipe.
- Tick Update existing products only if you will tick it in the WooCommerce importer too. The prediction depends on it.
- Click Run dry-run check.
The result shows a quality score, the predicted Create, Update and Skip counts, error and warning totals, the column mapping, and an issues table with the line number, level, code and message for each problem. Line numbers match your spreadsheet: the header is line 1, so the first product is line 2.

Four codes in that table are about identifiers clashing. All are documented, with every other code, on the issue codes page.
| Code | Level | What it means |
|---|---|---|
duplicate_sku | Error | The same SKU appears on more than one row of the file. The first row with the SKU is accepted; every later row with it is flagged. |
duplicate_id | Error | The same product ID appears on more than one row. |
duplicate_global_unique_id | Error | The same GTIN, UPC, EAN or ISBN appears on more than one row. |
duplicate_header | Error | The SKU column (or ID, GTIN, Name, price, stock or Parent column) appears twice in the header. WooCommerce would read only one of them. |
Errors block: a row with any error is counted under Errors rather than Create or Update, and the page shows “Do not import until every blocking error is fixed.” The quality score drops 8 points per error and 2 per warning.
Two details worth knowing. Catalogafe compares SKUs exactly after trimming surrounding spaces, so TEE-01 and tee-01 are two different SKUs to the dry run; whether your database treats them as equal depends on its collation, so keep one casing. And the duplicate check runs before the existing-product check, so a repeated SKU is flagged even on rows that would otherwise be skipped.
SKUs that already exist in your store
The dry run also looks each SKU and ID up in your store (a read-only lookup, cached per value, that ignores products still in the importer’s temporary importing state). A row whose SKU or ID matches an existing product is predicted as:
- Update when “Update existing products” is ticked;
- Skip, with the warning
will_skip_existing, when it is not. This is the dry-run equivalent of the importer’s “A product with this SKU already exists.” message.
So if you expected a file of new products and the result shows a large Skip or Update count, your SKUs collide with the catalog. Download the fix report (CSV with severity, line, code, message columns, or JSON) and work through the lines. For the full dry-run walkthrough, including mapping and the other checks, see how to validate a WooCommerce product CSV before import.
Find duplicate SKUs already in your store
For products that are already live, use Products → Catalog Health, Catalogafe’s read-only audit of the existing catalog. Click Run catalog audit.

The audit loads every product and variation with a status of published, draft, pending, private or scheduled (trashed products are excluded, matching WooCommerce’s own rule), up to 10,000 in ascending ID order, and checks each one. For SKUs it reports:
| Code | Level | Message |
|---|---|---|
duplicate_sku | Error | Products #456 and #123 share SKU “TEE-01”. The second ID is the earlier product that already holds the SKU. |
missing_sku | Warning | Product #789 has no SKU. |
Because the audit walks products in ID order, the lowest ID keeps the SKU and every later product that repeats it gets its own duplicate_sku row pointing back at that first one. Three products on one SKU produce two rows, both naming the same original. Variations are audited alongside parents, so a variation that clashes with a simple product is caught.
The result page shows a health score (same formula as the dry run), Products, Ready, Errors and Warnings cards, the parent and variation counts, and a table of issues keyed by product ID. The first 200 issues are shown on screen; the CSV and JSON downloads hold up to 5,000, and the totals always count everything. The JSON report also records whether the audit reached the 10,000-product limit.
It is strictly read-only. The audit never edits, trashes or renames a product, which is why it is safe to run on a live store during business hours. The Catalog Health docs list the other checks it runs at the same time (missing images, prices, descriptions, variable products with no variations).
Duplicate GTIN, UPC, EAN and ISBN values
Since WooCommerce 9.1 every product has a GTIN, UPC, EAN, or ISBN field next to the SKU, exported as a column with that exact name. WooCommerce enforces uniqueness on it the same way it does for SKUs, so a duplicate barcode fails the save with “Invalid or duplicated GTIN, UPC, EAN or ISBN.” Catalogafe checks the field in both places:
- In the CSV:
duplicate_global_unique_id(error) when the same value is on two rows;invalid_global_unique_id(warning) when the value doesn’t look like a barcode, meaning it must start with a digit and contain at least seven characters made of digits, hyphens and an optional final X for ISBN-10; andglobal_unique_id_exists(warning) when the value already belongs to a product in your store. - In the store:
duplicate_global_unique_id(error) with both product IDs, andinvalid_global_unique_id(warning) for values containing anything other than digits, hyphens and X.
Treat global_unique_id_exists seriously even though it is a warning. If that row is going to be created as a new product, WooCommerce will refuse it as a duplicate barcode. It is a warning rather than an error because the row may legitimately be the same product under a new SKU, in which case you want to import it with update mode on, or fix the identifiers so they match the existing product.
How to fix duplicate SKUs
Once you know which products or rows collide, the fix is to decide which one keeps the SKU and change the others. Catalogafe reports; it never repairs, so the edits are yours. If the import also failed for other reasons, every WooCommerce CSV import error, explained covers the rest.
In a CSV, before import
- Open the fix report and filter the code column to
duplicate_sku,duplicate_idandduplicate_global_unique_id. - For each flagged line, decide whether it is a true duplicate (delete the row) or a different product with a copy-pasted SKU (give it its own SKU).
- If the row is meant to update an existing product, keep its SKU, tick “Update existing products” in both Catalogafe and the WooCommerce importer, and make sure its ID (if present) points at the same product the SKU does.
- Run the dry run again until the Errors card reads 0 and the page says “No blocking errors found.”
In the store
- A handful of products: open each flagged product ID from the Catalog Health table, change the SKU in the Inventory tab (or in the variation’s own SKU field), and update. WooCommerce’s check confirms the new value is free. Quick Edit on the Products list also has a SKU field when SKUs are enabled.
- Many products: export the affected products with the WooCommerce exporter, change the SKUs in the spreadsheet, dry-run the file with “Update existing products” ticked, and import with that option on. Match by ID for this job: the SKU is the field you are changing, so it cannot be the key.
- A duplicate caused by restoring from trash: decide which of the two is current, give the other a new SKU or trash it again, and don’t restore it without renaming.
- A duplicate created on purpose by a plugin: if a marketplace or vendor plugin allows shared SKUs through the
wc_product_pre_has_unique_skufilter, that is a configuration decision, not a data error. Expect Catalog Health to keep reporting it.
After fixing, run Catalog Health again. The duplicates should disappear from the table and the Errors card should drop by the number you fixed.
A worked example
A seven-line restock file for a small apparel store. The store already has a product #88 with GTIN 0012345678905 and a product #112. “Update existing products” is left unticked in both Catalogafe and WooCommerce.
ID,Type,SKU,"GTIN, UPC, EAN, or ISBN",Name,Regular price,Stock
,simple,TEE-BLK-M,,Black tee (M),19,40
,simple,TEE-BLK-L,,Black tee (L),19,25
,simple,TEE-BLK-M,,Black tee (M) restock,19,60
,simple,MUG-01,0012345678905,Logo mug,12,100
,simple,MUG-02,0012345678905,Logo mug (large),14,80
112,simple,CAP-RED,,Red cap,15,30
Catalogafe’s dry run reports:
| Line | Level | Code | Issue |
|---|---|---|---|
| 4 | Error | duplicate_sku | The same SKU appears in more than one row. |
| 5 | Warning | global_unique_id_exists | This global unique ID already belongs to another product. Verify it before importing. |
| 6 | Error | duplicate_global_unique_id | The same GTIN, UPC, EAN, or ISBN appears in more than one row. |
| 7 | Warning | will_skip_existing | This product already exists and WooCommerce will skip it unless “Update existing products” is selected. |
The cards read Create 3, Update 0, Skip 1, Errors 2, Warnings 2, and a quality score of 80 (100 minus 2×8 minus 2×2). The page says “Do not import until every blocking error is fixed.”
What would have happened without the check: WooCommerce’s importer creates the tee from line 2, then reaches line 4, finds the SKU now exists, and skips it with “A product with this SKU already exists.” The restock of 60 units never lands and nobody is told why beyond a row number. Line 5 fails outright, because its barcode belongs to product #88 and the row would be a new product. Line 6 fails for the same reason against line 5 (or against #88). Line 7 is skipped, which was probably not the intention for a restock file.
The fix: line 4 is a true duplicate, so merge its quantity into line 2 (stock 100) and delete it. Line 5 turns out to be product #88 under a new SKU, so either put #88’s existing SKU on the row and import with update mode on, or drop the GTIN. Line 6 needs its own barcode or a blank cell. Line 7 should be imported with “Update existing products” ticked. Dry-run again: Errors 0, and the import can go ahead.
FAQ
Why does WooCommerce say “Invalid or duplicated SKU” when I save a product?
Another product or variation that is not in the trash already uses that SKU. WooCommerce checks uniqueness across all products and variations on every save with a non-empty SKU. Change the SKU, or find and rename the other product. Products → Catalog Health in Catalogafe lists both product IDs for every shared SKU.
Why does the WooCommerce importer say “A product with this SKU already exists”?
The row’s SKU matches an existing product and “Update existing products” was not ticked, so the importer skipped the row. If you meant to update, re-run the import with the option on. If the SKU appears twice inside the same file, the first row created the product and the second was skipped as existing; fix the file.
Does WooCommerce allow duplicate SKUs at all?
Not through its own save path. Duplicates arise from direct database or meta writes, migration tools, restoring a trashed product whose SKU was reused, or a plugin that overrides the check with the wc_product_pre_has_unique_sku filter. A blank SKU is not a duplicate: WooCommerce only checks non-empty values.
How do I find duplicate SKUs in WooCommerce without a plugin?
Export all products with the WooCommerce exporter, sort or conditionally format the SKU column in a spreadsheet, and look for repeats. Include variations in the export, since they have their own SKUs. For a repeatable check that also covers GTINs and names, a read-only audit such as Catalog Health is quicker.
Are SKUs case-sensitive in WooCommerce?
WooCommerce compares SKUs in a database query, so whether TEE-01 and tee-01 count as the same depends on your database collation. Catalogafe’s dry run compares them exactly after trimming spaces and treats them as different. Pick one casing convention and keep to it.
Does Catalogafe fix the duplicates for me?
No. Catalogafe is read-only by design: it never creates, updates or deletes products and never edits your file. It tells you the line or product ID of every duplicate SKU, ID and GTIN; you make the change in the spreadsheet or the product editor and run the check again.
