CSV Upload: default category

This topic contains 7 replies, has 2 voices, and was last updated by  mar mop 10 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #20559

    mar mop
    Buyer
    Post count: 82

    I am creating a csv file for a bulk upload of my Places. I am noticing that the first category I add in the post_category is not necessarily the default category. How can I check what the default category will be? To make sure I do not have to edit 130 items later?

    Thanks!

    #20560

    Simone
    Expired Member
    Post count: 3515

    Hello, good question….
    I took look in the database, this is what you could do (test it with some entries):

    Check the ID of the category you want to be set as default (you can check going in your post type categories and see the number in the CAT. ID column, for example the category Attractions is ID 2).

    Next step is to add a column in your CSV named “default_category” and in here you will insert 2 as it is the category ID for Attractions.
    Hope it’s clear

    #20579

    mar mop
    Buyer
    Post count: 82

    Hi Simone,

    Thanks for you reply. I think I understand: I just add a column with the title ‘default_category’ and for that I fill in ‘318’ without the ID in front of it. Then just unload the cdv file, right?

    I remember @guust saying that the sequence of the column is important, so I checked my database and see that the column ‘default_category’ is before ‘post_tags” so that is where I place it in the csv file too right?

    Thanks

    #20580

    mar mop
    Buyer
    Post count: 82

    Just saw something else: where does it leave all the other categories? In my database there is just one column for ‘default_category’ so where do the other categories stay? Or will it be an entry like this: ‘318, italian restaurants, moderate budget’ if I want to mention more categories?

    #20582

    Simone
    Expired Member
    Post count: 3515

    for the other categories you just use the csv as normal, so you will write as usual “1st category, 2nd category, etc”.. in the post_category and then you will add default_category with the id for the default category.
    Practical example:

    1st category id=1
    2nd category id=2
    3rd category id=3

    under post_category you will add 1st category, 2nd category, 3rd category
    under default_category you will add 1

    #20583

    mar mop
    Buyer
    Post count: 82

    Ok, but that means adding an extra column that is not in the database – is that ok and it will not mess up anything?

    #20584

    Simone
    Expired Member
    Post count: 3515

    That column IS in the database.
    Check the attached screenshot.

    #20586

    mar mop
    Buyer
    Post count: 82

    Oh yes, off course. Sorry you are right. Cool I’ll do it this way. Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount