Skip Navigation

[Resolved] How to create a hierarchical category from a CSV file?

This support ticket is created 4 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 4 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#1479983

Tell us what you are trying to do?
- I have a long list of school names with the parent-child relationship (District Name > School Name)
- I want to import the CSV file into a Category of a custom post type (School).
- Each school's category to be inserted from the pre-build category so that I can select one rather than type one.
- My CSV file looks like the following:
District Name, School Name
District1, School1-1
District1, School1-2
District1, School1-3
District2, School2-1
District2, School2-2
District3, School3-1
District3, School3-2

How can I import such a formatted CSV file so that I can build a category?

Thank you.

#1480319

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I'm not sure I quite understand the structure of your data, and whether the taxonomy terms already exist on your site, or whether the import process should create them.

In any case, we have documentation about importing content from CSV files here: https://toolset.com/documentation/user-guides/export-import/how-to-import-content-into-wordpress-using-csv/

That link describes free and paid options.

The tool I'm most familiar with is WP All Import, and with the free version you can import posts with taxonomy terms assigned (including generating the terms if they do not already exist on your site), but the paid version is required if you also want to import custom fields at the same time.

See their documentation about importing taxonomies: hidden link

Whichever tool you use to import your CSV file the documentation for that product is likely to be the best guide, but if you get stuck let me know and I'll see if I can help.