To ensure the hierarchy of categories is maintained during import in WooCommerce, follow these guidelines:
1. Use the correct format in your CSV file:
- For hierarchical categories, use the "greater than" symbol (>) to separate parent and child categories.
- Example: "Parent Category > Child Category > Grandchild Category"
2. Include the full hierarchy path for each category:
- Always specify the complete path from the top-level parent to the deepest subcategory.
- Example: "Electronics > Computers > Laptops > Gaming Laptops"
3. Maintain consistency in naming:
- Use exact category names as they appear in your WooCommerce store or as you want them to be created.
- Be consistent with spelling and capitalization.
4. Use a single "Categories" column:
- Put all category information, including hierarchies, in one column.
- Separate multiple category paths with commas.
5. Order matters:
- List parent categories before their children in your CSV file.
- This helps ensure the parent categories are created before their subcategories.
6. Use quotation marks for complex names:
- If a category name contains commas or special characters, enclose it in double quotes.
- Example: "Computers & Tablets > Laptops"
7. Use WP All Import or similar advanced plugins:
- These tools often have better support for maintaining category hierarchies during import.
8. Test with a small sample:
- Before importing your entire catalog, test with a small set of products to ensure the hierarchy is maintained correctly.
9. Check existing categories:
- If you're importing into a store with existing categories, make sure your import data matches the existing hierarchy structure.
10. Use category IDs for precision:
- If available, using category IDs instead of names can ensure exact matching and prevent duplicate categories.
By following these guidelines, you can maintain the hierarchical structure of your categories during the import process in WooCommerce. Remember to always back up your database before performing any large-scale imports.
Citations:[1] https://stackoverflow.com/questions/62375207/woocommerce-import-products-with-subcategories
[2] https://www.webtoffee.com/woocommerce-import-product-categories/
[3] https://wpdesk.net/blog/woocommerce-import-categories/
[4] https://woocommerce.com/document/product-csv-importer-exporter/
[5] https://oxygenbuilder.com/import-product-categories-woocommerce/