“Invalid or duplicated SKU” in WooCommerce: where it shows up and how to find the product that has your SKU
Despite the wording, WooCommerce has no format rule for SKUs: this message always means another product or variation already has that SKU. Here is where it shows up, what happens to your changes, and how to find the product that holds it.
In this article14 sections
This message means WooCommerce refused a SKU because another product or variation in your store already uses it. The word invalid is misleading: WooCommerce has no rule about which characters a SKU may contain or how long it can be. Uniqueness is the only thing it checks.
What happens next depends on where you saw it. In the product editor, everything else you changed is saved and only the SKU is left as it was. Through the REST API or an import, the whole product or row is refused.
The exact message#
Invalid or duplicated SKU.
Who sees it: Store owners and developers. In the classic product editor it appears as a notice at the top of the screen after you press Update or Publish; for a variation it appears in the Variations tab after Save changes. The REST API returns it as error code product_invalid_sku with status 400, and the product importer lists it under Reason for failure.
What WooCommerce checks#
Every time a SKU is set through WooCommerce, whether by the editor, the REST API or the importer, it runs the same check:
- An empty SKU is always accepted.
- Otherwise it looks for any other product or variation with the same SKU, in any status except Trash. Drafts, pending and private products count.
- If one exists, the SKU is refused with this message.
Where you see it:
- Classic product editor: a notice at the top of the screen. The product is saved with its old SKU, or with no SKU if it’s new.
- Variations tab: the same notice after Save changes, per variation.
- REST API: error
product_invalid_sku, status 400. Nothing is saved. The error data includesresource_id, the product that holds the SKU, andunique_sku, a free alternative with -1, -2 and so on added. - CSV import: the row fails and is counted under “Failed to import”.
- Quick Edit: no message at all. If the SKU is taken, Quick Edit quietly keeps the old one.
Causes and how to fix each one#
1. Another product or variation already has the SKU#
The usual case. Variations don’t appear as rows on the Products screen, and drafts are easy to forget, but both hold their SKUs. Only a product in the Trash gives its SKU back.
Check: Type the SKU into the search box on Products > All Products. The search covers drafts, private products and variation SKUs; a matching variation shows up as its parent product.
Fix: Change the SKU on one of the two products. If you need a consistent set of new codes, the <a href=”/free-tools/sku-generator/”>SKU generator</a> builds them from a pattern.
2. A variation was given its parent’s SKU#
A variation with an empty SKU shows the parent’s SKU in grey inside its SKU field. That’s a placeholder, not a value: the variation inherits the parent’s SKU for display while its own stays empty. Typing the same text into the field gives the variation a real copy of the parent’s SKU, and WooCommerce refuses it.
Check: Open the variation in the Variations tab. If the SKU you typed is the parent’s SKU from the Inventory tab, this is the cause.
Fix: Leave the field empty to inherit the parent’s SKU, or give the variation its own, such as TEE-RED-S.
3. Two products already share the SKU, so every save fails#
The check also runs when you save a product without touching its SKU. If two products already have the same SKU (because one was written by a database edit or by a plugin that stores the SKU without going through WooCommerce), each of them shows this message on every Update, and the SKU never changes.
Check: Search for the SKU on Products > All Products. Two results with the same SKU confirm it.
Fix: Give one of them a new SKU and save it. The other will save normally from then on.
4. An import row points to one product by ID and another by SKU#
With Update existing products ticked, a row that has an ID updates the product with that ID, and then tries to give it the SKU from the row. If that SKU belongs to a different product, the row fails with this message. It typically happens when the ID column came from another store.
Check: Hover over the product with the row’s ID on Products > All Products and compare its SKU with the SKU in the row.
Fix: Set the ID column to Do not import on the Map CSV fields to products screen, so rows are matched by SKU only.
5. Hidden data still holds the SKU#
The check reads WooCommerce’s product lookup table, not the product itself. If a SKU was changed outside WooCommerce, for example straight in the database, the table can still show the old SKU for that product. An import that was interrupted can also leave hidden placeholder products named “Import placeholder for …” that hold SKUs until the importer’s next clean-up.
Check: If the search finds no product with the SKU, go to WooCommerce > Status > Tools, find Product lookup tables and press Regenerate, then try again.
Fix: Regenerate the lookup tables. If the SKU is held by an import placeholder, run a complete import and let it finish: the importer removes its placeholders at the end.
6. A plugin changed the uniqueness rule#
Plugins can replace or tighten the check through WooCommerce filters. If no other product has the SKU and the lookup tables are fresh, a plugin is the remaining explanation.
Check: Use the Health Check & Troubleshooting plugin to turn off other plugins for your own session only, then save the SKU again.
Fix: Change that plugin’s settings, or contact its developer.
Quick reference#
| Cause | How to check | Fix |
|---|---|---|
| Another product or variation already has the SKU | Type the SKU into the search box on Products > All Products. The search covers drafts, private products and variation SKUs; a matching variation shows up as its parent product. | Change the SKU on one of the two products. If you need a consistent set of new codes, the <a href="/free-tools/sku-generator/">SKU generator</a> builds them from a pattern. |
| A variation was given its parent's SKU | Open the variation in the Variations tab. If the SKU you typed is the parent's SKU from the Inventory tab, this is the cause. | Leave the field empty to inherit the parent's SKU, or give the variation its own, such as TEE-RED-S. |
| Two products already share the SKU, so every save fails | Search for the SKU on Products > All Products. Two results with the same SKU confirm it. | Give one of them a new SKU and save it. The other will save normally from then on. |
| An import row points to one product by ID and another by SKU | Hover over the product with the row's ID on Products > All Products and compare its SKU with the SKU in the row. | Set the ID column to Do not import on the Map CSV fields to products screen, so rows are matched by SKU only. |
| Hidden data still holds the SKU | If the search finds no product with the SKU, go to WooCommerce > Status > Tools, find Product lookup tables and press Regenerate, then try again. | Regenerate the lookup tables. If the SKU is held by an import placeholder, run a complete import and let it finish: the importer removes its placeholders at the end. |
| A plugin changed the uniqueness rule | Use the Health Check & Troubleshooting plugin to turn off other plugins for your own session only, then save the SKU again. | Change that plugin's settings, or contact its developer. |
Reproduced on a test store#
We set up each case below on a clean WooCommerce 11.2.1 store on 6 November 2026 and recorded exactly what it showed.
| What we did | What WooCommerce showed |
|---|---|
| Two published simple products: A with SKU MUG-1, B with SKU MUG-2. Open B in the classic editor, set SKU on the Inventory tab to MUG-1, press Update. | Invalid or duplicated SKU. B kept SKU MUG-2. |
| A is a draft with SKU DRAFT-1. Create a new simple product, enter SKU DRAFT-1, press Publish. | Invalid or duplicated SKU. |
| Variable product with SKU TEE and one variation with an empty SKU. Type TEE into the variation's SKU field and press Save changes. | Invalid or duplicated SKU. |
| Authenticated as an administrator, POST /wp-json/wc/v3/products with {"name":"Copy","sku":"MUG-1"}. | Invalid or duplicated SKU. HTTP 400, code product_invalid_sku, suggested unique_sku MUG-1-1. |
| Move A to the Trash. Set B's SKU to MUG-1 and press Update. | No message. The change was saved. |
For developers#
The exception is thrown by WC_Product::set_sku() with code product_invalid_sku. To find the product that holds a SKU, run this in wp shell:
$id = wc_get_product_id_by_sku( 'MUG-1' );
var_dump( $id, get_post_status( $id ), get_post_type( $id ) );Two filters control the test: wc_product_pre_has_unique_sku short-circuits it when it returns a boolean, and wc_product_has_unique_sku receives the data store’s answer. wc_product_generate_unique_sku() returns the same -1, -2 suggestion the REST API sends as unique_sku.
Where this lives in WooCommerce 11.2.1:
includes/abstracts/abstract-wc-product.php,WC_Product::set_sku: Throws the message when the SKU is not empty and not unique. Uniqueness is the only test.includes/wc-product-functions.php,wc_product_has_unique_sku: Runs the data store check, with the wc_product_pre_has_unique_sku and wc_product_has_unique_sku filters around it.includes/data-stores/class-wc-product-data-store-cpt.php,WC_Product_Data_Store_CPT::is_existing_sku: Looks for another product or variation with the same SKU in wc_product_meta_lookup, any status except trash.includes/admin/meta-boxes/class-wc-meta-box-product-data.php,WC_Meta_Box_Product_Data::save: Shows the error as an admin notice; the other fields are still saved. save_variations does the same for each variation.includes/rest-api/Controllers/Version3/class-wc-rest-crud-controller.php,WC_REST_CRUD_Controller::save_object: Turns the exception into a 400 response and saves nothing.includes/admin/class-wc-admin-post-types.php,WC_Admin_Post_Types::quick_edit_save: Quick Edit checks first and silently keeps the old SKU, so it never shows the message.
Related WooCommerce errors#
- A product with this SKU already exists.
- Invalid or duplicated GTIN, UPC, EAN or ISBN.
- No matching product exists to update.
Back to the WooCommerce error reference.
Frequently asked questions#
Are there characters a WooCommerce SKU can't contain?
WooCommerce itself has no character or length rule. The product editor strips HTML and trims spaces before saving. The only reason WooCommerce refuses a SKU is that another product already has it.
Did my other changes save?
In the product editor, yes. Only the SKU is left unchanged. Through the REST API or an import, nothing from that request or row is saved.
Can a variation have the same SKU as its parent?
Not as its own SKU. Leave the variation’s SKU empty and it will show the parent’s SKU instead.
Does a product in the Trash block the SKU?
No. Trashed products are left out of the check. If you restore a trashed product whose SKU has since been taken, WooCommerce adds -1 (or the next free number) to its SKU.
Why doesn't Quick Edit show this error?
Quick Edit checks the SKU itself before saving and, if it’s taken, keeps the old SKU without saying so. Check the SKU column after a Quick Edit.
Are SKUs case-sensitive?
No. In our import tests WooCommerce treated ABC and abc as the same SKU.