How to import category name in magmi in magento

How to import category name in magmi in magento

September 8, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to import category name in magmi in magento

Solving Category Import Issues in Magento using Magmi

Hello, fellow e-commerce developers! Today, we’re diving deep into an issue that many of us face while working with Magento and the Magmi extension for product imports: how to correctly import category names along with your products.

Understanding Your Current Setup

First, let’s analyze the data structure you’ve shared:

sku;name;attribute_set;categories
100;"Product 1";"Default";"SHOP"
101;"Product 2";"Default";"SHOP/About Us"

You’re using Magmi to import products, and your CSV format seems correct at first glance. However, the issue lies in how Magento interprets category paths.

The Problem: Category Paths vs. IDs

Magento uses a hierarchical system for categories, represented by paths like SHOP or SHOP/About Us. When you specify these paths in your import file, Magmi tries to find matching categories based on their names.

The problem arises when the category name doesn’t match exactly with what’s stored in Magento. This can happen due to:

  1. Spaces: Magento treats leading and trailing spaces differently from Magmi.
  2. Case sensitivity: Magento is case-sensitive for category names, while Magmi isn’t.
  3. Special characters: Some special characters or accents might be interpreted differently.

The Solution: Using Category IDs

To ensure a precise match between your import data and the existing categories in your Magento store, use category IDs instead of paths.

Here’s how to do it:

  1. In your Magento admin panel, navigate to Catalog > Categories.

  2. Locate or create the categories you want to associate with your products.

  3. Note down their ID numbers (visible under the ID column in the grid view).

  4. Update your CSV file to include these category IDs instead of paths:

sku;name;attribute_set;category_ids
100;"Product 1";"Default";"9"
101;"Product 2";"Default";"9,3"

In the example above:

  • The SHOP category has an ID of 9.
  • The About Us sub-category under SHOP has an ID of 3.
  1. Re-import your products using Magmi.

Verifying Your Import

After re-running the import with category IDs, you can verify that the products have been correctly assigned to their respective categories:

  1. Check your Magento admin panel (Catalog > Products).
  2. Click on a product’s name.
  3. Go to the Categories section in the left-hand menu.

You should see that the products are now linked with the appropriate categories based on their IDs.

Conclusion

Remember, when working with Magmi and Magento category imports:

  • Always use category IDs instead of paths for precise matching.
  • Double-check your CSV formatting, especially regarding spaces, case sensitivity, and special characters.
  • Clean up any unwanted or duplicate categories that might be causing conflicts.

If you’re facing more complex import challenges, feel free to explore our library of Magento tutorials at [https://laravelcompany.com/magento-tutorials]. We’ve covered everything from data mapping to performance optimization.

Catalog Extensions Import/Export Errors

Our network