• Resolved bigdrop.gr

    (@bigdropgr)


    Hi,

    I want to import categories to my site and I need to import them nested.
    Is this possible?
    I see there is an option for parent category but what if the hierarchy is like this Parent category > Child category > Grand Child category?
    Is it possible to add them with 3 levels (or even more) nested categories?

    I have multiply categories and there is another problem I would like to solve also. In some cases there are child categories with the same term but different parent category.
    Ex1 Greece > Local News > Sports
    Ex2 Cyprus > Local News > Sports
    How is it possible to insert the categories and not mix up things since the child category is the same in both cases?

    Ps. I am trying to import only categories from an csv file containing just categories and their hierarchy.

    • This topic was modified 2 years, 12 months ago by bigdrop.gr.
    • This topic was modified 2 years, 12 months ago by bigdrop.gr.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter bigdrop.gr

    (@bigdropgr)

    My file with categories looks like this:
    https://prnt.sc/12379kk

    I saw this thread where you suggest that “your import file should only contain a single category per-record with a reference to the parent category”.

    So, I guess that my upload file should look like this:
    https://prnt.sc/1237dyo

    Since I do have grand-child categories with the same name and the same child-category but different Parent category how do I make sure that everything will be nested properly on my site?

    I tried to import the file with all the categories with this structure https://prnt.sc/1237dyo and I ended up with all the grand child categories nested under the first child category with the same name.

    • This reply was modified 2 years, 12 months ago by bigdrop.gr.
    Plugin Author WP All Import

    (@wpallimport)

    Hi @bigdropgr,

    My file with categories looks like this: https://prnt.sc/12379kk

    Since you already have a file with this structure, and it looks like you do not need to import images/descriptions/etc to the categories, I would suggest that you use this workaround: https://gist.github.com/trey8611/b416466a3199f81df0eada8a1f7786c6.

    As for the options in this import type, nested/hierarchical categories are covered here: https://www.wpallimport.com/documentation/taxonomies/nested/. Keep in mind that you can build the hierarchy using elements too, e.g.:

    {Parent[1]} > {Child[1]} > {Grandchild[1]}

    Since you’re importing the full hierarchy, the duplicate child names will import to the correct parent(s).

    So, I guess that my upload file should look like this: https://prnt.sc/1237dyo

    If you go this route, since you have duplicate names, you’ll need at least these three columns in the file:

    • Category Name
    • Category Slug
    • Parent Slug

    Here is an example file for reference: https://d.pr/f/VXSMhH. Note that you’ll import the slug and parent slug in the “Other Category Options” section of the import template.

    Thread Starter bigdrop.gr

    (@bigdropgr)

    Hi,

    I used the first workaround and it work.

    Thank you very much

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Import categories hierarchy’ is closed to new replies.