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:
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.
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"
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.
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
Inside the Loop, you can use the wpv-post-id shortcode to get the post ID:
You can use the wpv-post-title shortcode to get the 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.
Thanks that worked, now if only I can figure out how to get all that data into separate rows and columns in Excel.
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.