Keep leading zeros in WooCommerce SKUs when editing CSV files

A SKU is an identifier even when it contains only digits. If a spreadsheet turns 00041 into 41, an update can stop matching the intended product. Fix the editing workflow before trying to fix the importer.

Import the SKU column as text

In Excel, use the data import workflow for a text or CSV file and set the identifier column to Text before loading it. Microsoft’s guidance below covers leading zeros and large-number conversion. Avoid relying on a double-click open to choose the right type for every column.

Use a tiny control set: 00041, an alphanumeric SKU and a long identifier. Compare them with the original text file immediately after loading. Do not apply a formula that prepends zeros to every value; suppliers may use several valid identifier lengths.

Separate a display format from stored data

A custom number format can make 41 look like 00041 in a sheet. That does not establish that the underlying identifier or exported CSV is correct. Inspect the saved CSV as text, and re-import it explicitly as text for a second comparison.

Quotation marks in CSV define field boundaries; they are not a universal instruction to spreadsheet software to preserve a value’s type. Keep a documented text-column import step for everyone who edits the file. Do not use spreadsheet formulas such as an equals-prefixed expression to represent SKUs in an import file.

Recover damaged values from a trustworthy source

If the zeros have already disappeared, compare against the original supplier export or a known-good store export. Product names can help a human review a match, but a name alone is not a safe unique key for an automated repair. Quarantine ambiguous matches instead of guessing.

The sample catalog uses 00041 deliberately. Our parser test and WooCommerce staging fixture retain that exact string. Use the same check on a fresh export from your store after the pilot update. Reconcile counts as well as identifiers: an unexpected new product can reveal that an intended update failed to match.

Check the result

  • Original, working sheet and final CSV contain the same exact SKUs.
  • Long identifiers have not been rounded or converted to scientific notation.
  • A staging update changes the original product ID rather than creating a duplicate.

Documentation for this workflow

Check the instructions for your installed version before changing a store.

Need a second pair of eyes?

We can review the source and agree a repair scope. Start with CSV file repair or staging import help.

Ask about import help