Stockrows

Guides

Diese Anleitung auf Deutsch

"Invalid or duplicated SKU", and prices or stock on the wrong products after a WooCommerce import

You imported a CSV file with Update existing products ticked. The last screen says Failed to import 2 products, and View import log shows Invalid or duplicated SKU. Or a row was skipped with No matching product exists to update. Or the screen says 32 products updated, your products look as before, and other products carry the new prices.

In short: three different things lead here. Two products share one SKU: their rows fail, and nothing changed on them. A SKU was changed in the shop since the export: the old file puts the old SKU back, or skips the row. Or the shop still holds marks of an earlier import that broke off, and the importer took your IDs for other products: here the way back needs an export or a backup from before.

First, read what the importer says

On the last screen, select View import log. It lists each row that failed or was skipped under Product, with a Reason for failure. Rows that were updated are counted and not listed: WooCommerce keeps no list of the products an import changed.

Two products share one SKU

WooCommerce's product editor refuses a SKU that another product has. An older import, a plugin or a copy of a product can still leave two products with the same SKU. The importer writes each row's SKU onto its product, WooCommerce refuses it, and the whole row fails.

In our test shop two products shared the SKU ART-001. A file of ID, SKU and Regular price, 32 rows: Import complete! 30 products updated. Failed to import 2 products, and the log named both, "ID 180, SKU ART-001" and "ID 181, SKU ART-001". The two products had not changed in any value. The same happened with a file of SKU and Regular price alone.

The way out

  1. Nothing is to be undone: a failed row changed nothing, and the other rows are right.
  2. Find the two. In Products → All Products, type the SKU from the log into the search field and select Search products. In our shop the list showed both products.
  3. Import the failed rows by ID alone. Make a file of those rows with the ID column and the columns you are changing, and no SKU column. In our shop a file of ID and Regular price updated both twins: 32 products updated, each product with its own price. Open both products afterwards and see the new value there: the sentence counts rows and does not say where they went (see below).
  4. Or give one of them its own SKU in the product's Inventory tab, and write the new SKU into your file too. With the old SKU still in the file, that row failed again in our shop.

A SKU was changed since the export

A file is as old as its export. In our shop we changed one product's SKU from ART-003 to NEW-003 after the export, and imported the old file:

The way out

Rows landed on other products: marks of a broken-off import

This is the rare one, and the one that does harm quietly. When products are added from a file that has an ID column, as when a shop is moved, and "Update existing products" is not ticked, the importer gives each new product a hidden mark with the ID from the file. It takes all marks off when an import runs to its end. If that import broke off, by a closed tab or a server that gave up, the marks stay. For every row of a later file, the importer looks for a product with such a mark first, and only then for the product that has that ID.

In our test shop we imported a file of 150 products of another shop and closed the tab at 40 of 100. The shop then held 90 new products, each with a mark. Then we imported a price file for the shop's own 32 products, by ID, with the box ticked:

The way out

  1. Do not import the file a third time to see what happens. The second run is already right. The harm is what the first run wrote onto other products.
  2. If you have an export from before that import, one that holds all products of the shop: make a file from it with the ID column and the columns your file changed, the SKU column among them if your file had one, and import it with the box ticked. In our shop a file of ID and Regular price from such an export said 123 products updated, and every price in the shop was as before. Then we imported the price file again, and it changed the 32 products it was meant for.
  3. If you have no such export, WooCommerce cannot tell you which products were changed: the marks are gone, and no list is kept. The values are then in a backup of the site, or have to be set again by hand. In our shop the products that were hit were those of the broken-off import. Putting a whole backup back also takes away every order since it was made, so ask your host first whether single values can be read from it.

The limits of this way out: it puts back the columns you take from the old export, with the values of that day. What changed in the shop between that export and the accident is not in it.

So that it does not happen again

If you would sooner change prices and stock with no file at all: Stockrows is our paid Google Sheet for a WooCommerce shop. It lists every change before anything is sent and keeps the old values of each push. How it works.

We tried every step on this page on 29 and 30 November 2026 in a test shop of our own: WordPress 7.1.5, WooCommerce 11.3.1, through the admin's own Import screen, with each product read before and after. The words in bold are those of these versions' screens. The reasons come from the code of WooCommerce 11.3.1 (includes/import/class-wc-product-csv-importer.php) and from WooCommerce's page Product CSV importer and exporter. Another version, or a plugin that changes the import, may behave differently: try a file of two or three rows first.

Related guides