Home›Support›English Support›[Resolved] Translations not linked properly via WP All Import — only the first item is associated correctly
[Resolved] Translations not linked properly via WP All Import — only the first item is associated correctly
This thread is resolved. Here is a description of the problem and solution.
Problem: You are trying to import translated custom post types using WP All Import Pro (WPAI) with WPML. The issue arises where only the first item in the translated import is correctly linked to its French counterpart, while subsequent English posts are created with correct content but remain unlinked. This results in orphan translations because no WPML hooks or WordPress post-save hooks are triggered after the first item. Solution: We recommend checking if you have used both WPML addon import plugins, as this might interfere with the import process. Ensure that all settings and checkboxes during the setup are correctly configured. It's crucial to use the correct version of the JSON file for the import, as discrepancies can lead to issues like missing categories or improper displays. If issues persist, consider deleting the problematic posts or restoring the staging site to a version before the problematic import. Additionally, ensure that any necessary taxonomies exist and are translated before importing your posts.
If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am trying to import translated custom post types using WP All Import Pro (WPAI) with WPML. I have set up two imports: one for the original language (French) and one for translations (English). The custom field id_projet is used as a unique identifier in both imports. In the English import, the French import is selected as the source, and the matching field is dynamically set as {id_projet[1]}. The ACF multilingual sync options are configured to 'copy', and the option 'Disable do_action calls in wp_insert_post' is unchecked. All involved plugins (WPAI, WPML, ACFML) are up to date. Link to a page where the issue can be seen: [URL not provided].
Symptoms:
Only the first item in the translated import is linked properly to its French counterpart. All following English posts are created with correct content but remain unlinked, resulting in orphan translations. No WPML hooks or WordPress post-save hooks are triggered after the first item, preventing the WPML post-creation logic from running.
Questions:
Why are only the first items linked properly while others remain unlinked?
Are there any specific WPML or WordPress hooks that should be triggered during the import process?
Languages: English (English )Spanish (Español )Italian (Italiano )
Timezone: Europe/Rome (GMT+02:00)
Hello,
I'll try to help you out while a supporter takes your case.
If the content is not linked by languages it means that the procedure may have been done correctly but the IDs on the site do not match in both language.
Just to make sure I explain myself correctly: If you had a project_id = 1 In english, and you are exporting spanish, then project_id must be 1 in spanish as well.
We ask to create a new field exactly because that makes sure they have the same values on all the languages.
Can you send over the import files so we can try to spot any possible issue there? we can also test with that locally to see if we find any issue.
thanks, I have tried to import them to Post CPT and in minimal but same issue happens. You might want to delete those posts or restore staging site to before version.
I have then tried to create new import using your template and it seems to work fine like that. Not sure if there is some additional settings / checkbox you have set or maybe because you have used both WPML addon import plugins, that might be causing the issue, but if look now they are imported fine with Import ID 4/5 and it works fine.
It does look like your import worked correctly this time, which is great. However, I'd really appreciate it if you could explain in a bit more detail why it worked, especially regarding what might have caused the previous issues.
You mentioned something about using "both WPML addon import plugins", could you please clarify what you mean by that? Which plugins specifically are you referring to, and how might they interfere with the import process?
Also, could you please share the exact steps you followed to get the successful import (Import IDs 4/5) working? That would help me a lot in understanding what to do differently next time.
And what did you mean by "You might want to delete those posts or restore staging site to before version.", because as I see the site now, only the last projets you generated are present on the website.
2) Sure, I went and clicked New import and selected your JSON file. Then loaded saved template, and saved FR import and run it. Then did same for EN import, just selected inside template that this is EN language and parent Import is FR ID 4. Run it and it worked fine.
3) I am referring to Posts > All (hidden link), since I also imported 10 posts there to test and debug issue. I tried to find and delete them myself, but I have trouble finding them in 70 other FR posts, as I do not speak French.
Hope this helps, let me know if there is anything else I can do for you.
Thanks for the clarification and for taking the time to test things further.
I went ahead and deleted everything, then re-ran both imports using the same method you described. However, now I'm facing a new issue: the French posts no longer appear on the front-end, even though everything seems fine in the back-end (they’re listed properly, with the correct language, content, etc.).
Before I deleted and reimported everything, the French posts were displaying correctly, including one post that was showing in both French and English. So something seems to have broken along the way.
Could you please help me understand what might be causing this? I’d really appreciate a more precise explanation, since I’ll need to reproduce the process on the production site and want to make sure everything is solid before doing so.
Also, I noticed that the plugin “WPML Export and Import” is now deactivated, did you deactivate it yourself or was it already that way?
Thanks again for your support. Looking forward to your insights so I can get this finalized properly.
1) I checked and I can see FR language just fine: hidden link
I am not sure if you are facing something else, but best is to check how you are showing and built your FR post frontend. Most likely using some custom template for this as I can see next "single-projets.php".
Might be something was changed when I switched theme. It would be quicker if you just check with who ever built website, as they will know what is needed / missing for showing content on frontend.
2) Yes, I disabled WPML Import Export myself.
Hope this helps, let me know if you have any other question or doubts.
that page has set to show post that have category "reference generale", but there is no post with that category assigned, maybe I have not set it correctly in import template.
- hidden link
- hidden link
Please adjust your page loop on what you wish to show, or assign some post to that taxonomy.
Also note that before importing your post you need to make sure that taxonomy exist and is translated. Currently you do not have any taxonomy in EN, please first translate them before making import of your posts.