How to import Countries->States/provinces->Cities as a custom hierarchal taxonomy

Question

I’m building a website where people can upload custom posts on the front end and add countries/cities as a custom taxonomy (location categories) that are easily searchable.

I’ve been able to add all countries and their most popular cities using the bulkpress plugin, but this has been long winded and sub optimal as including states in the hierarchy would take days. And I wasn’t able to list all cities due to storage issues.

https://raw.githubusercontent.com/dr5hn/countries-states-cities-database/master/countries%2Bstates%2Bcities.json

I’ve found the following JSON file on github containing all countries with their states and cities, but I have no idea how to save it and importing it into wordpress in a usable format. It would be prefect if I could somehow convert it all into one large custom taxonomy as that would be easy to integrate into wordpress search functionality.

Any help would be hugely appreciated

0
Peter McNulty 3 weeks 0 Answers 5 views 0

Leave an answer