Skip Navigation

[Resolved] Importing Post Relationships

This support ticket is created 6 years, 3 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 7 replies, has 2 voices.

Last updated by Christian Cox 6 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#603488
Screen Shot 2018-01-04 at 9.54.44 AM.png
Screen Shot 2018-01-04 at 9.55.05 AM.png
Screen Shot 2018-01-04 at 9.55.16 AM.png

I am trying to: Link child posts to the parent. Moving data from another site. I have imported the parent custom posts "Artists" which has many different artists. The child posts are "Concord Albums" and I am able to see the Post Relationship but when using WP Import Pro I map my related artist for example "Mavis Staple" to the custom field _wpcf_belongs_artist_id but it does not work. Is this because the relationship is not an actual artist name but a id number in the backend? How can I do this? There are thousands and will take forever having to do it manually. See screenshots.

Link to a page where the issue can be seen:

I expected to see:

Instead, I got:

#603567

I map my related artist for example "Mavis Staple" to the custom field _wpcf_belongs_artist_id but it does not work. Is this because the relationship is not an actual artist name but a id number in the backend? How can I do this?
You're close - the relationship is not an artist name, but an ID. It should be the Artist ID on the new site, which doesn't match the Artist ID on the old site. I don't know if there's a way in WP All Import to map to the new Artist post ID based on the old Artist post ID. I'm not an expert with their software, so I think you should reach out to their support team to see if there's a way to do that. Let me know what you find out, and we can take it from there.

#603568

Okay, so even though I map the related artist field which says "Mavis Staples" to the _wpcf_belongs_artist_id field, which if you search in on child edit page will bring up "Mavis Staples", it wont work that way?

Is there an easy way to export the "artist" names with their corresponding "id" out of toolset? Maybe if I can do that I could use some excel magic to replace the artist name "Mavis Staples" on the import side with the "id"

#603578

Correct, mapping to the Artist name will not help you in Toolset. You must have the artist ID. If you want to access artist IDs and names on the new site, you could just create a simple Toolset View of Artists on the new site. In the Loop Output, include the Artist ID and Artist name. Separate them with commas to generate a comma-separated list on the front-end of your site. With a bit of formatting magic, you could create a CSV file out of that output, then open that CSV file in a spreadsheet editor.

#603587

Okay, I can get the name but what do I use to call the Artist id in the loop output? Sorry, I am brain dead. What will the code look like in the loop?
Thanks

#603595

Inside the Loop, you can use the wpv-post-id shortcode to get the post ID:

[wpv-post-id]

You can use the wpv-post-title shortcode to get the post title:

[wpv-post-title]

It'll probably take some trial and error to get just right. I created a basic spreadsheet and saved it in CSV format to see how it should look. Here's the format:

Artist ID,Artist Name
1,Joe Smith
2,Jane Smith

Your View should output a similar format. Then copy and paste the results into a blank text file created in Notepad or something similar. Save it as 'file.csv'. You'll be able to open that file in a spreadsheet editor.

#603599

Thanks that worked, now if only I can figure out how to get all that data into separate rows and columns in Excel.

#603600

Excel should be able to open a CSV file and automatically format it into rows and columns. If it's not opening correctly, there's probably something wrong with the format of your CSV file. Check the format carefully, because line breaks and comma spacing are important.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.