Title: Import categories from csv?
Last modified: August 19, 2016

---

# Import categories from csv?

 *  [jwack](https://wordpress.org/support/users/jwack/)
 * (@jwack)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/import-categories-from-csv/)
 * Im looking for an easy way to import a list of categories. I have 2 main categories
   that will need filled out with sub-cats.
 * I found [this post](http://wordpress.org/support/topic/282246?replies=2) but 
   im not sure I understand how to edit the code to make it work for me.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/import-categories-from-csv/#post-1187994)
 * You many not need to edit the code. Put the file named `cat.txt` in your wp-content/
   themes/YourThemeName folder. That file should contain YOUR categories in a similar
   style to:
 * “category1″,””
    “category2″,”” “cat1 subcat1″,”category1” “cat1 subcat2″,”category1”“
   cat2 subcat1″,”category2” “cat2 subcat2″,”category2”
 *  Thread Starter [jwack](https://wordpress.org/support/users/jwack/)
 * (@jwack)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/import-categories-from-csv/#post-1187998)
 * MichaelH – I have a couple quick questions.
    - What happens if I add a sub-category that already exists?
    - Back on your original post, where would I put the php that calls the text 
      file?
    - Lastly, this is compatible with 2.8.4?
 * Thanks very much!
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/import-categories-from-csv/#post-1188024)
 * 1. I believe it overwrites the existing category with the new information. Remember
   subcats must be unique even if they have different parents
    2. Could put it in
   a [Page Template](http://codex.wordpress.org/Pages) or in my case I just stuck
   it in my themes index.php, let it execute then deleted the code. 3. Seems to 
   work with 2.8.4 4. Backup your database before attempting!
 *  [abiswift92](https://wordpress.org/support/users/abiswift92/)
 * (@abiswift92)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/import-categories-from-csv/#post-1188109)
 * CSV 2 POST does this and you can do 3 levels

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Import categories from csv?’ is closed to new replies.

 * 4 replies
 * 3 participants
 * Last reply from: [abiswift92](https://wordpress.org/support/users/abiswift92/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/import-categories-from-csv/#post-1188109)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
