Creating categories using CVS importer


First of all I would like to complement WPMU with the latest release of the Directory plugin!
It works great and I love the new short codes and the CustomPress integration.

I have a listing with over 1400 listings in it and I used CSV importer to import them into Directory.
That (almost!) works perfect. Each listing is generated and all the custom fields are generated as well!

The thing I can't get to work are the categories. I know you can't give support over the CSV importer tool, but I hope someone out there can help me with this.

The thing is that when I use the standard post categories in the importer (csv_post_categories) all categories (main, child, grandchild) are created perfect using the field value "Arts > Paintings > Modern", but when I change it to the listing categories (csv_ctax_listing_category) it's generating one category called "Arts > Paintings > Modern".
When I use "Arts, Paintings, Modern" it just isn't working good. Sometimes a sub category is created and sometimes it's not. I don't know what's happening there.

I started entering the categories by hand and started assigning each listing to the right category...... I stopped after 34 listings, what a hell of a job to do :slight_frown:

So I hope somebody has succeeded in doing this the right way? Please let me know.


  • jongag1
    • The Crimson Coder


    I don't know...
    When there are more than 1 cat in the listing, sometimes the seconds get's in there, other times the first.

    Perhaps characters like 'or / can cause it? I will test that out and tell you the results. But not today anymore, I'm going to enjoy the sun!

    And thanks for rating me helpful in a different post :slight_smile:


  • jongag1
    • The Crimson Coder


    Can't get it to work right.
    Removed all strange characters and did an import.

    The result is strange when I look in the listing categories.
    It says there are 8 items in it, but I can only see 1. Please see the attachment.

    Also I included the test csv I used. Perhaps somebody has a brilliant idea!


  • jongag1
    • The Crimson Coder

    Hmm, it's getting stranger. When I look in the dropdown of the categories (in Dutch Hoofd) I can see the other categories. They just don't show up on the right side.
    When I create a new category and make it a sub-cat of the existing one it does show up.

    Plz see the screendump...


  • jongag1
    • The Crimson Coder

    I got it :slight_smile:

    What I did:
    - stopped ussing 2 layers of cat's. Max 2 cat's
    - After importing all categories are in it, but sub cat isn't vissible
    - add a category by hand and tell it is a sub cat of a main cat
    - after saving refresh the page, now all sub-cat's become vissible
    - delete the temporary cat and you're done.


  • HamRadioDude
    • HummingBird

    ar you saying that we can't import more then 2 sub cats into the DB
    I need to enter example:
    Arts & Humanities
    -Art History
    -Art Weblogs
    -Chats and Forums
    -Criticism and Theory
    -Cultural Policy
    -Cultures and Groups
    -Design Arts
    -Job and Employment Resources
    -Local History
    -Museums, Galleries, and Centers
    -News and Media
    -Performing Arts
    -Shopping and Services
    -Visual Arts

    Could you Share How you imported it what tables to associate what tables you used

  • jongag1
    • The Crimson Coder

    Hi DirectoryDude,

    In my case, yes. When I had 3 subcat's I couldn't get it done.
    If you look into the attached file called test4.txt you can see the csv format I used and the databasefileds, but I used:
    csv_post_type: directory_listing
    csv_ctax_listing_category: for the categories (in format: maincat, subcat)
    csv_post_title: for the title of the listing
    ct_Straatnaam_text_c7a7: Is a custom field, in my case the address.

    Though keep in mind in the example file there are still 2 listings with 3 subcat's which I corrected in a later csv file :slight_smile:


  • jongag1
    • The Crimson Coder

    So you're example could be done with no problem:

    "Arts and Humanities, Art History"
    "Arts and Humanities, Art Weblog"
    "Arts and Humanities, Artists"
    "Arts and Humanities, Visual Arts"

    Noticed I changed the & into and?

    After importing you can change the category back again. I experienced problems using characters like / and ' so perhaps it's better not to use & as well.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.