Home Forums Plugin Support WP User Frontend Pro Import CSV

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  noomia 6 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2530

    noomia
    Participant
    Post count: 115

    Hi Tareq,

    I have a custom post type called “companies”. I have created a few custom fields with your plugin.

    Now, I have a .csv file with 150 companies. I need to import them and map the custom fields with the right value in the csv.

    How could I do this ?

    Thanks !

    #2538

    Tareq Hasan
    Keymaster
    Post count: 2831

    You can use just raw PHP to read the CSV files. Then run a loop and use wp_insert_post() to insert those companies and use update_post_meta() to associate those values in right custom fields.

    #2541

    noomia
    Participant
    Post count: 115

    Ouch… It seems to be difficult to me… Could you please give me a small example ๐Ÿ™‚ ?

    I've tried with the plugin : WP Ultimate CSV Importer. I was allowed to choose the custom post type and allowed to map my csv cells with the good custom field (for example : “CF:address”). It creates my company but only with post_title and post_content, nothing else.

    After that I've seen that the plugin allow to assign a cell to a custom field with let me assign the name of the field. I have tried with “address” instead of the suggested “CF:address” and it works well.

    But I still have a problem. I've checked in WPUF settings to “Show custom fields on post content area”. So normally on a single company page, it has to list the custom fields, but it doesn't ! When I edit one of these companies, I have to chose the “WPUF Form”, then update the post, and finally it works. But as I said, I have 150 companies and don't want to edit each one by one.

    So when I import my companies, do I have to assign a value to a specific field to let it know that it has to use the right form ?

    Thank you very much !

    #2545

    Tareq Hasan
    Keymaster
    Post count: 2831

    Yes, every post needs to assign a custom field `_wpuf_form_id` with the required form ID.

    #2556

    noomia
    Participant
    Post count: 115

    It works ๐Ÿ™‚ Thanks !

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

The topic ‘Import CSV’ is closed to new replies.