I have 3,000 products in a spreadsheet. When I use the WooCommerce importer, rerunning it creates duplicates or fails with a timeout. What is the right approach?
DEV3 Developer Forum
How do I bulk import WooCommerce products from a CSV without duplicates?
Every post is reviewed first. Usually reviewed within 24 hours.
1 reply
Use the built-in importer (Products > Import) with a stable identifier, and keep batches manageable.
Update, do not recreate. In the importer's mapping step, enable "Update existing products". WooCommerce matches on ID or SKU. SKUs must be unique, and the CSV column should be named SKU. If you leave SKU empty, every row becomes a new product.
Minimum columns: Type, SKU, Name, Published, Regular price, Categories, Images, In stock?, Stock.
Notes on formats:
- Categories:
Clothing > Shirts, Sale(hierarchy with>, multiple separated by commas). - Images: comma-separated URLs (the first becomes the featured image); the server must be able to download them.
- Variable products: first a
variableparent row, thenvariationrows withParentset to the parent SKU, and attributes inAttribute 1 name/Attribute 1 value(s). - Save as UTF-8 CSV, delimiter comma. Excel regional settings sometimes use semicolons; set the delimiter in the importer's advanced options.
Timeouts. The importer processes in batches via AJAX, but slow image downloads can hit PHP limits. Raise max_execution_time and memory_limit, or split the file into 500-row chunks. WP-CLI avoids browser timeouts if you use a plugin or script that offers a CLI importer.
Pitfalls
- Test with 10 rows on staging first, and export existing products before overwriting.
- Run an export after import to compare counts.
- After import, regenerate the lookup tables if WooCommerce prompts (WooCommerce > Status > Tools) and clear caches.
- Prices with currency symbols or thousand separators import as text; use plain numbers like
19.99.