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:
- The screen said Import complete! 33 products updated, and nothing else.
- All 20 products and variations with an empty cell had stock management switched off, and their quantity was gone.
- A sold-out product and a sold-out variation, both Out of stock before, were In stock.
- A product that allowed backorders was In stock too, with backorders no longer allowed.
- A product with a low-stock threshold of its own lost that threshold as well.
- The rows that held a number got it, and nothing else about them changed.
Which products were hit
- From the file you imported: the rows whose Stock cell is empty. In our shop these were exactly the 20 products that changed.
- Without the file: make a new export (Products → All Products, Export, Generate CSV). Every row with an empty Stock cell is a product that counts no stock now. Among them are the ones that never did, such as a voucher or a download: take those out by hand.
- In the product list: the Stock column shows "In stock" with no number in brackets.
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.
- Make a new export now and keep it, as the record of the shop before you repair it.
- 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?andLow stock amount. Leave no Stock cell empty. - 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.
- 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.
- 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:
- Each product its own number: a file of
IDandStockwith a number in every row, imported as above. This reaches variations too. - Many products the same number: in Products → All Products, tick the products, choose Bulk edit in the Bulk actions menu and select Apply. Set Manage stock? to Yes, set Stock qty to Change to: with the number, and select Update. In our shop: 9 products updated, and all nine had that number, also the ones that had a number of their own before. Variations are no rows of this list, so the bulk edit does not reach them.
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
- A file for the importer never holds an empty Stock cell for a product that counts stock. Delete the rows you are not changing, or delete the whole Stock column if the file is about something else, such as prices.
- Export before every import, and keep the file unchanged. With it, the repair above is a small job and not a new count.
- Check the file first. Our free CSV import checker reads the file in your browser and names every row with an empty Stock cell, with what the importer would do to it.
- After a stock count, our free stock count tool writes the import file for you: only the rows whose count differs from the shop's stock, each with its number.
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.