• 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 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)
  • 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

    (@jwack)

    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!

    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 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!

    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.