Importing categories with CSV
Import category data into a category tree from CSV files, including creating new categories with their hierarchy
Category imports work through the same CSV import wizard as products — with one addition: categories always belong to a category tree, so every category import is scoped to one tree that you pick in the first step. Like all CSV imports, the result is a proposal you review before anything is published.
Selecting the tree
- Open Proposals and pick your CSV file as usual
- In the Entity Matching step, select the Categories card
- Choose which category tree to import into
Selecting Categories deselects the other entity types — a category import can't be combined with product, variant, SKU, or metaobject imports in the same file.
Matching rows to categories
Rows match on the category ID column, and IDs only need to be unique within the selected tree — two trees can each have a category with the same ID without conflict. You can also match on an attribute value instead, using any single-value attribute of the selected tree.
The preview shows how many rows matched existing categories and how many were not found.
Creating missing categories
When rows don't match any existing category, you can toggle Create missing categories. Because categories live in a hierarchy, Emfas needs to know where each new category belongs. There are two ways to express that, and you pick one in the wizard:
Full path column (default)
A column holding each category's complete path, including the category itself as the last segment:
cat_id,catname,category_tree
79,Barn,Start Page > Barn
80,Barnkläder,Start Page > Barn > Barnkläder
81,Mössor,Start Page > Barn > Barnkläder > Mössor- The separator (
>above) is detected automatically from your data and can be adjusted —/and|work too. - The parent of each category is its path minus the last segment, matched against the tree and the other rows by name.
- Ancestors that don't exist anywhere — no CSV row and no existing category, like
Start Pageabove — are created automatically, with an ID derived from their name (start-page). If you don't want a wrapper root like that, remove the segment from your paths before importing. - Category names can repeat in different branches (a
MössorunderBarnand another underDamare distinct categories); placement always follows the full path. - A name column is optional in path mode — the last path segment is used as the name when no name column is mapped.
Parent ID column
A column holding the ID of each category's parent. Leave it empty for root categories:
category_id,name,parent_id
barn,Barn,
barnklader,Barnkläder,barn
mossor,Mössor,barnkladerThe parent can be another row in the same file (order doesn't matter) or a category that already exists in the tree. A name column is required in this mode.
Matched categories are never changed
The import only ever creates categories that don't exist yet. Rows that match existing categories update their mapped attributes through the proposal — the category's name and position in the tree are left untouched.
Mapping attributes
The Data Mapping step works exactly like other imports, except the available attributes are the ones defined for the selected tree (Settings → Categories → your tree → Fields). Map your remaining columns, pick languages for localized attributes, and create the proposal.
Related
- Importing data with CSV — the general import wizard
- Exporting data with CSV