I have 250+ categories and sub categories with me. I want to import it in my magento 2. It is not possible to manually add it. Can anyone help me with some scripts or code to import categories from csv. Please dont reccomend any extension unless it is free.

1 Answer 1


Check below link maybe that'll help you:


And create a module as per the instruction.

This will Import a category with its subcategories programmatically.

I also suggest you to remove/disable this module once you have successfully imported category.

  • I tried this. but does not work. There is some issue with this module. It displays blank page.
    – Nafsss
    Commented Feb 4, 2020 at 11:17

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.