Stockrows

Guides

Diese Anleitung auf Deutsch

A WooCommerce CSV import switched off stock management: how to switch it back on

You imported a CSV file with a Stock column. The last screen said Import complete! 33 products updated. Since then the product list shows In stock for many products where it used to show In stock (13), a product that was sold out is on sale again, and in the product's Inventory tab the box Stock management, "Track stock quantity for this product", is no longer ticked.

In short: every row of the file whose Stock cell was empty told WooCommerce to stop counting stock for that product, and WooCommerce then dropped the old number. The shop no longer holds those numbers. They come back from a file made before the import, or from a new count. Until then these products sell without a limit.

What happened, and why

WooCommerce's importer reads the Stock column in two ways. A number sets the quantity and switches stock management on for the product. An empty cell switches stock management off. And where the file has no In stock? column, the importer also sets such a product to in stock. This is written in the importer's code, and it is the same for a product and for a variation. When a product stops counting stock, WooCommerce clears its quantity and sets Allow backorders? back to "Do not allow".

An empty Stock cell comes about quickly: you export the products, fill in new numbers for the ones you counted, and leave the others blank, meaning "no change". The importer does not read a blank that way.

This is what we saw in our test shop with a file of ID, SKU, Name and Stock, 33 rows, 20 of them with an empty Stock cell, imported with Update existing products ticked:

Which products were hit

The way out

First decide whether the shop should pause: until the numbers are back, the products that were hit can be ordered in any quantity, and orders take nothing off their stock.

If you have a file from before the import

That is an export you made before, or the export you started from, before you edited it. It holds the old numbers.

  1. Make a new export now and keep it, as the record of the shop before you repair it.
  2. From the old file, make a file that has only the rows of the products that were hit, and these columns: ID, In stock?, Stock, Backorders allowed? and Low stock amount. Leave no Stock cell empty.
  3. Go to Products → All Products, select Import, choose the file, tick Update existing products, and select Continue. On the Column mapping screen each column must show its own field.
  4. The last screen says products updated, with the number of rows. That sentence counts rows and is no proof of where they went, so open two or three of the products and look at their Inventory tab. In our shop: Import complete! 20 products updated, and every one of the 20 was as before the accident: stock management on, the old quantity, the old stock status, the backorder setting and the low-stock threshold. If your products are unchanged, see rows that landed on other products.
  5. Correct the numbers for what was sold since the old file was made. The file is as old as its export, and the orders since the accident took nothing off.

We also tried a file of ID and Stock alone. Stock management and the quantities came back, but the product that had allowed backorders stayed Out of stock with backorders not allowed, and a product's own low-stock threshold stayed empty. So take the other three columns along.

If you have no such file

Then the old numbers are in a backup of the site or nowhere. Putting a whole backup back also takes away every order and change since it was made, so ask your host whether single values can be read from it. Otherwise count the products that were hit, and set the numbers:

Do not set "Manage stock?" to "Yes" without a number. We tried it: the six products that had lost their stock count got it back with no quantity, and all six were Out of stock at once.

The limits of these ways: neither brings back a number that no file holds, and neither knows what was sold in the meantime.

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