Skip Navigation

[Resolved] Import relations one 2 many.

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 5 replies, has 2 voices.

Last updated by Beda 5 years, 4 months ago.

Assisted by: Beda.

Author
Posts
#1290763

HI,
I have a csv file with provinces and places, like this
province1;place1
province1;place2
province1;place3
province2;place4
province2;place5

I made custom post types for provinces and places and fill it up with all names.

But how can I bulk import all this provinces and places to relationships?

#1290879

We elaborate extensively on import of relationships here:
https://toolset.com/documentation/user-guides/importing-content-from-csv-with-post-relationships/

We also have a broader document on import in general:
https://toolset.com/documentation/user-guides/how-to-import-content-into-wordpress-using-csv/
There, we also show Plugins, which allow importing data
These Plugins elaborated there are mostly the same, however, WordPress Ultimate CSV Importer is currently the most powerful given it supports also relationships and relational fields

Please let me know if you need more help with this!

#1290939

Sorry but Im dumb, and I still don't understand.
Can you show how csv file should look like?

#1290983

We cannot craft ready to go CSV files, but in the documentation, it is explained step by step how to create one.
There are as well examples:
https://toolset.com/documentation/user-guides/importing-content-from-csv-with-post-relationships/#an-example-of-how-a-csv-would-look-like

That example is built on an M2M (Many to Many) relationship, "School - Class", with the slug "school-class".
It connects parents post type Teachers with the child post type Kids.

There are example associations, where “Mr. A”, “Mrs. B”, “Tom” and “Brian” are the titles of the posts. Obviously the "mr." posts are teachers, "tom" and "brian" are kids

The CSV looks like:
https://toolset.com/documentation/user-guides/importing-content-from-csv-with-post-relationships/#an-example-of-how-a-csv-would-look-like

Then you import that CSV, and once this data is imported by any CSV Importer as post meta you will see the associations on the Toolset > Export / Import > Associations screen, where you can finalize the import of relationships.

The CSV as you shared it in your initial post cannot serve much when importing posts, as any CSV import Plugin will require some structure, titled by what it is.
A CSV for import must have the heading (ID post_author post_title …(all other post fields)… custom_postmeta_key another_postmeta_key etc), and all it's values under it.
These things are required to insert the proper post with proper ID and so on in the database, otherwise no import plugin will know what to import where.

I suggest to go thru that DOC step by step, as it explains what I explained above in much more details
Or - you can always opt for a plugin as shown here:
https://toolset.com/documentation/user-guides/how-to-import-content-into-wordpress-using-csv/how-to-import-data-from-a-csv-file-using-the-wp-all-import-toolset-types-add-on-plugin/
You can then (at the end) import the Relationships https://toolset.com/documentation/user-guides/how-to-import-content-into-wordpress-using-csv/how-to-import-data-from-a-csv-file-using-the-wp-all-import-toolset-types-add-on-plugin/post-relationships/

The documentation will lead you to each step, with sample CSV's included.

#1291907
tutorial.png

Where I can find tutorial for reference site? The link from description not lead to tutorial. Video Library on info page also doesent work.

#1292523

These are unrelated issues to this topic, please open up a new ticket for new issues - one issue one ticket.
https://toolset.com/toolset-support-policy/

This allows us to focus on one issue a time and solve it satisfyingly.

1. Tutorials for reference site you show there can be found here:
https://toolset.com/learn/how-to-build-a-real-estate-website-on-wordpress/
==> I have confirmed locally the button there does nothing and we will fix that in imminent updates to the sites

2. Video Library on info page also doesent work.

I do not know what you mean here, in any case, it would be required to open a new ticket for this new, separate issue.
Here we can proceed to handle the CSV Import details.

Thank you!