Hi I am importing products in my new setup, I already added the categories. when i import the csv product file, all go well. But the problem is the product is added to only subcategory, it is not added to root category at the same time. If the subcategory and root category both are not checked in product edit page then product does not show on the front end. I want every product to be added to root and sub categories, I have tried it in many ways but have not succeeded yet. Below are some ways i have applied (3 is root category id and 13 is sub)

  Abc, 3|13, Root Catalog

  Abc, '3,13', Root Catalog

  Abc, 3/13, Root Catalog

  Root Catalog/Abc, Root Catalog

  Abc, Root Catalog

even have applied them in single and double quotes as well.

Any help would be very much appreciated.

3 Answers 3


Import using Magento's System > Import/Export > Dataflow Profiles. Make a comma-delimitted list of category_ids with sku as the key. Save it out as a CSV file:


When imported with Dataflow, the category_ids for the skus will be replaced with the categories as listed above so make sure you catch all of the categories otherwise their current assignment will be replaced with those uploaded.

If you need store id-based categories use the following, where store is the store code:

  • thanks for the answer. how can i import multiple images of a single product? how can separate them in media gallery attribute in csv file? comma thing does not work there. Commented Jul 26, 2013 at 4:26
  • No problem. That is a separate question and one I would be glad to answer if you would post it separately as it would exceed the scope of the comments section.
    – philwinkle
    Commented Jul 26, 2013 at 4:49
  • What do you do if the category names have commas in them? Is there another separator that would work? Commented May 12, 2015 at 22:10

You can also use a great free tool MAGMI which allows import fields "category_ids" and "categories"

Regarding the format for category_ids philwinkle already advised - it's the same as for Dataflow Profiles - comma separated list of categories ids.

As for "categories" column, if you download and enable a plugin "Category creator" for Magmi, it will create needed categories on fly. The format is following: Category1;;Category2/Subcategory2;;Category3/Subcategory3/SubSubCategory3

You can also try this extension which is basically MAGMI integration into Magento interface with a lot of extended functionality. It solves this tasks very easily, you can export/import with preserving proper columns mapping.


Add Multiple categories

Add your current store category name.

$importData['categories'] = "[Store_Root_Category_Name]/CurrentStoreCatName1/CurrentStoreCatName2/CurrentStoreCatName3";

If your craete category already then you simply assige category id to product import array.

$importData['category_ids'] = "1,2,3,4,5,7";

Multi-Store Category Import

In our case Main Store English and Current Store IT. Add Below Data To Your Import Data Array

$importData['categories'] = "[Default_Root_Category_Name]/CurrentStoreCatName1::[MainStoreCatName1]/CurrentStoreCatName2::[MainStoreCatName2]/CurrentStoreCatName3::[MainStoreCatName3]";

Enable Below Setting from Magmi

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.