Magento: Category Import Script?

Currently, there is no way to import categories unless you write your own script or sql. I may have a project coming up soon that will require importing a lot of categories, so I may have to build a better script (I’ve built a couple crappy ones already) for importing them. But, before I do that, I’d like to get some feedback.

First – CSV setup. What I’m assuming the best global way to import is from a CSV (correct me if I’m wrong). In that case, what do you think the best format of the CSV should be? My initial thoughts would be 2 columns. First one for the category name, second (if used) is for which category name the category is nested under. (I suppose there could be other columns as well for Enabled or Disabled, meta, image, etc.)

Second – Anything else that would be useful for a category import script?

I can’t guarentee that I’ll be able to have the time to do this – but we’ll see. The better and level of feedback I get, the more motivation I’ll probably have!

This entry was posted in Magento. Bookmark the permalink.

11 Responses to Magento: Category Import Script?

  1. Ruchir says:


    Here is a solution for all of you….I’ve made this one since long time…i’ve used myself too…so its 100% working.

    see details :


  2. Captain Tycoon says:

    Any luck on this? I’m trying to import over 500 categories (with sub’s). This is because I am importing over 25,000 products from a drop shipper.

    Would really like to know how I can import / map the categories…

  3. robert says:

    i think they have that already

    but i wasn’t able to install it yet.

    can anyone create a simple how to guide?

  4. Bash says:

    Did you ever figure out a good way to import categories in Magento?

  5. John says:

    I would love to have a utility that imported categories, a bit like easy populate does in OS commerce (did I just swear :)

    Vinai’s got the idea right, with the structure – I’m surprised that something like this isn’t already built into magento, but that would be too easy….

    I would definitley pay for this scripts as it could save me hours/days of time.

    All the best,

  6. websuperman says:

    I think it might be most flexible to allow a single category in the import file and have the script look at a seperate configuration file that “maps” category fields from the import file to the category in magento. It’s kinda a set it and forget it kind of thing but would also allow merchants that get product data from various sources to create their own category schema and map it in the configuration file without first having to fix their data being imported. This would also allow multiple categories from the input file to be mapped to a single category. IE. “Thumbtacks” and “PushPins” could both be mapped to “Bulletin Board Supplies” something like

    This is just a quick idea of how the config file could be. It could also be used to set defaults for categories in the event it’s not specified in the import file. Things like weight, additional shippig cost, thumbnail image, etc. like:

  7. Josh Pratt says:

    Very good idea Vinai! You could definitely run into issues with multiple category names that are the same name.

  8. Vinai says:

    Ah, I was a bit unclear…

    This could be a simple structure:


    and so on

  9. Vinai says:

    I don’t think csv is suited.
    The problem with names is that there can be more then one category with the same name, e.g. Women / Shirts / Leisure and Men / Shirts / Leisure

    Why not import using “paths” like the above? The seperator could be configurabe so it doesn’t have to be a slash, in case that’s used in a category name.

    I think it also would be neat to be able to specify the category id, too, maybe Women (1) / Shirts (5) / Leisure (7)
    But that might be a bit too messy 😉

    This tool would be great!

  10. eric says:

    I really want to see category creation couples with product importing. it’d be really great to just feed in a huge csv w/ products in cats and sub cats and just get the ball rolling.