Bulk importing categories into WP
-
I am migrating my website from another CMS to WP.
I have a csv file with more than 10,000 rows with 6 columns – continent, continent_id, country, country_id, city, city_id.
I wish to import these as nested categories in WordPress with the category name as slugs. There will be 3 levels (continent -> country -> city)I need a solution which would help me do this efficiently – it can either be a plugin or a php script that I run once to import the data.
If I am not wrong a custom taxonomy would solve it, but I’m not too advanced at WP and not sure how to build a solution myself.
The challenges are:
1) Some city and country names are the same (e.g., country-> Hong Kong, city-> Hong Kong). WordPress does not allow duplicate slugs. In this case it is OK to add a 2 behind the duplicate (i.e., city) slug to differentiate it from the country slug
2) I want the continent, country and city IDs to be preserved somehow as as I need to bulk import posts into WP later using the IDs as identifiers linking the posts to their respective categories.Any advice or help would be much appreciated!
The topic ‘Bulk importing categories into WP’ is closed to new replies.