Skip to content Skip to sidebar

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.

Tagged: 

This topic contains 14 replies, has 1 voice.

Last updated by mathiasJ-2 1 week, 1 day ago.

Assisted by: Dražen.

Author Posts
July 21, 2025 at 3:36 pm #17256579

mathiasJ-2

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?

July 23, 2025 at 7:45 am #17262151

mathiasJ-2

Hi there,

I'm stuck on this one, I would really need your help. Could you at least confirm this is a bug, or tell me what I should fix in my setup.

Thank you in advance,

Best regards

July 23, 2025 at 1:35 pm #17264150

Alejandro
WPML Supporter since 02/2018

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.

Regards,

July 23, 2025 at 2:00 pm #17264340

mathiasJ-2

Hello,

I added screenshots to my first post. You can see I'm always using "projet_id" to link both posts.

Besides, even if I already debugged it just in case, this value always matches as both imports are from the same file.

Moreover, I can't edit the import file, it belongs to my client.

You can check my import file here : hidden link

Thank you for your help

July 23, 2025 at 2:14 pm #17264379

mathiasJ-2

I can share with you access to my staging website if you'd like. How can I share them privately ?

July 25, 2025 at 9:17 am #17270393

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks for getting back, I will be taking over the case and checking further.

Please share access to staging site, and delete all imported posted, so I can to few tests from scratch on my own, and try to see what is wrong.

Regards,
Drazen

July 28, 2025 at 6:43 am #17273782

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks, I tried but get same results as you do.

Please disable object cache, and let me know if it is okay to disable other plugins / themes to debug further.

Thanks,
Drazen

July 28, 2025 at 8:17 am #17274050

mathiasJ-2

Hello,

You can definitely disable plugins and themes for debugging purpose.

But keep in mind, if you disable child theme, you'll lose all my CPT "projet", since it is declared there.

Best regards

July 28, 2025 at 9:42 am #17274432

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

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.

- hidden link

Regards,
Drazen

July 28, 2025 at 10:57 am #17274570

mathiasJ-2

Hi Drazen,

Thanks for your message.

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.

Thanks again for your help!

Best regards,

July 28, 2025 at 11:20 am #17274612

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks for getting back, glad to hear it works fine now.

1) I am not sure if you have maybe used some additional checkbox or settings inside WP All Import, I tried to check but I do not see difference.

As per plugins there is WPML Import and Export, and WPML All import (legacy), those are 2 different plugins and use different approach for import.

- https://wpml.org/documentation/related-projects/wpml-export-and-import/
- https://wpml.org/documentation/related-projects/legacy-wpml-all-import/

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.

Regards,
Drazen

July 28, 2025 at 1:15 pm #17275220

mathiasJ-2

Hi Drazen,

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.

Best regards,

July 28, 2025 at 1:48 pm #17275582

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

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.

Regards,
Drazen

July 28, 2025 at 2:02 pm #17275656

mathiasJ-2

Yes, the singles are correctly displayed, but on the archive page, hidden link there is no projet the site is in french.

Before, I use to get all posts fr the french version, and the first entry projet for the english version.

So there is still something wrong with my posts.

July 28, 2025 at 2:08 pm #17275665

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

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.

Regards,
Drazen