Hierarchical Taxonomy Import for Drupal

[Here's a repost of an old post that didn't make it from the old Wordpress database into the new version of this site

If you need to import large amounts of data into a Drupal taxonomy, this may help you. I had a large (5000+ terms) vocabulary that was hierarchical. The solution wasn’t obvious, nothing existed to import them, and I didn’t want to do it by hand (it would’ve taken a whole day probably).

The solution was to format the terms by copying and pasting them from an Excel file, with some nifty markup. My database needed 3 levels of hierarchy and here’s a sample:

*Banjos

%Dean
Backwoods 3
Backwoods 5
Backwoods 6

Banjos is the first level, Dean is second and the rest are third level. You need the * and % to denote 1st and 2nd level respectively. (It only took about a half hour to mark up my list - not too bad)

The script will iterate through the terms, creating the taxonomy.

Perhaps this could be made into a modeule someday, but I don’t have the skillset to do so at this point (feel free to modify the code).

If it helps you, great, just remember to back stuff up before trying it! Don’t come crying to me… ;-)

Download —> [Taxonomy Import script]