How to merge simple products into variations in bulk with CSV
You have the same T-shirt as five separate products (S, M, L, XL, XXL) and want one product with variations? With hundreds or thousands of items you can't do it by hand. Here's the CSV approach.
1. Export and back up
Export products with the built-in exporter (Products → Export), back up the whole site and work on a staging copy first.
2. Group products by a rule, not a guess
Variations usually share a pattern in the name or SKU, such as "T-shirt Blue – XL" or ABC-123-XL. A simple spreadsheet or script rule (strip the size from the name or SKU) groups the vast majority reliably and the same way every time. Review the leftovers that don't match by hand. AI is useful for those leftovers, not for the whole catalogue.
3. Build the import file
- Parent product: type
variable, a new SKU, attribute Size with valuesS | M | L | XLand the "used for variations" flag. - Variation: type
variation, Parent = the parent SKU, the size value, price, stock and the original SKU. Keeping the original SKUs means stock sync, accounting and feeds keep working.
4. Test, then import in batches
Start with 20 to 50 products, then batches of a few thousand rows so the import doesn't time out.
5. Clean up without losing SEO
Don't delete the old simple products straight away; set them to draft. Add 301 redirects from their URLs to the new product, or you'll lose rankings and break links from ads and comparison sites.