Skip Navigation

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 10 replies, has 0 voices.

Last updated by Otto 1 month ago.

Assisted by: Otto.

Author Posts
May 14, 2025 at 12:00 am #17029879

sebastianS-153

Background of the issue:
I am trying to import translated versions of existing articles. We have 2 articles on our site in pt-pt. I downloaded these products via WP All Export Pro plugin. Then these posts were translated to English and the WPML necessary language codes were adjusted inside the CSV. I imported them via WP All Import Pro. I then clicked on the "run" button inside WPML Import Export. It showed no issues.

Symptoms:
However, the new en articles are now added as new separate articles. They were not mapped to the original articles, despite the import file containing the correct _wpml_import_translation_group ID

Questions:
Why were the articles not mapped? See the attached screenshot, this is the import file I used: hidden link

Thanks a lot, Sebastian

May 14, 2025 at 2:28 pm #17032905

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Can you please try this:
Validate and re-import with correct meta columns
• Open your CSV and confirm exact column names: _wpml_import_translation_group, _wpml_import_language_code, _wpml_import_source_language_code.
• Use one identical and unique value (e.g. “art-1234”) in _wpml_import_translation_group for the PT original and every EN translation row.
• For PT originals, leave _wpml_import_source_language_code empty; for EN translations set it to pt-pt. Set import type to update existing posts (match by ID/Unique SKU)
• Re-import with WP All Import Pro
• Run WPML → Export & Import → Run Import again.
• Verify in Posts → All languages that translations now appear under the translation pyramid.

Best Regards,
Otto

May 14, 2025 at 2:50 pm #17033157

sebastianS-153

Hi Otto, thanks for your message.

I spent around 5 hours troubleshooting. Can you tell me this, maybe this helps to clarify:

With WPML and WP All Import: Is it possible to import a (newly) translated post for an already existing original post, if the import file ONLY contains the new translated post? Or must all import files ALWAYS also contain the existing original posts?

"• Use one identical and unique value (e.g. “art-1234”) in _wpml_import_translation_group for the PT original and every EN translation row."

-> You mean instead of using "1234" as the group value for the (same) EN and PT article, I should use "art-1234" for both? And the next article would then use "art-3456" - did I understand correctly? So mixing static characters with flexible numerical?

"• Set import type to update existing posts (match by ID/Unique SKU)"

-> This I do not fully understand. Assume I have only one existing PT post. Now I want to import the English translation for this post. I need to also use "update existing posts"? Even if the English post does not exist on the site (yet)?

"• Re-import with WP All Import Pro"
"• Run WPML → Export & Import → Run Import again."

-> You say in the end here "Run Import again" -> you mean to run the fill import again with WP All Import Pro? With the same file? So basically importing twice?

Thanks a lot, Sebastian

May 14, 2025 at 6:08 pm #17034058

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello Sebastian,

The short answer is:
You can import a CSV that contains only the new English posts as long as the existing Portuguese post already stores the same _wpml_import_translation_group value; otherwise run a quick “update” import of the Portuguese original first to inject that meta, then import the English file and click Run WPML Import after each step.

Detailed explanation:

1. Can I import only the translation file?
• Allowed: When the Portuguese original already has the three WPML meta fields in the database (especially the _wpml_import_translation_group). In that case, the English row can be imported on its own; after you click WPML → Export & Import → Run WPML Import, the add-on detects the shared group value and hooks the two posts together.  
• Required to include originals: When the originals were never re-exported with the new add-on or lost their meta. A quick “update existing” import of the PT posts restores those fields; then you bring in the EN file and run WPML Import again. Several forum threads confirm that the two-step approach (re-import originals and then import translations), when the first run doesn’t link items.  

2. What should the _wpml_import_translation_group look like?
• Any unique string (numbers, text, or a mix) works. The only rule is that every language version of the same article shares the identical value, and no two unrelated articles reuse it. 
• So art-1234 + art-1234 is perfectly fine; 1234 + 1234 is just as good. What caused trouble in the sample you sent is that the PT originals use one value while the EN rows use a different one, so WPML can’t see them as a pair. 

3. Why “Update existing posts (match by ID)” when the English post doesn’t exist yet?
• That setting is only for the Portuguese “refresh” import (if you need it). By matching on the post ID or another Unique Identifier, you make sure WP All Import edits the existing PT post instead of cloning it. Once the meta is in place, you can run a second import for the EN file using “Create new items”.  

4. Do I really need to “Run Import again”?
• WP All Import brings the rows into the database, but they’re still language-agnostic.
• Every time you finish an import job you must go to WPML → Export & Import → Run WPML Import so WPML can attach the language information and connect translations. If you do the two-step workflow (PT refresh, then EN translations) you’ll click that button twice — once after each WPAI run.  
• You do not re-run the WPAI wizard with the same CSV unless you need to roll back and try different mappings.

5. Practical workflow that covers both scenarios

If originals already have the meta
1. Import EN CSV (Create new items)
2. Run WPML Import

If originals don’t have the meta
1. Import PT CSV (Update existing items)
2. Run WPML Import (adds meta)
3. Import EN CSV (Create new items)
4. Run WPML Import (links translations)

Either way, use the same _wpml_import_translation_group in every row that belongs together, set _wpml_import_language_code to en (for the translation) and _wpml_import_source_language_code to pt-pt. 

Best Regards,
Otto

May 14, 2025 at 7:25 pm #17034205

sebastianS-153

Hi Otto,

thanks a lot for the detailed answer. I wish I could replicate, but on my end when I import the file with the EN posts -> they are not mapped. I actually see that the _wpml_import_translation_group ID I gave them inside the import file changes (I can see so by exporting them again). I took a loom, I hope it helps figure this out:

hidden link

The loom ended a few second too early -> but inside the export file I created in the end, as suspected, the 2 EN posts each received an entirely new group ID. Also the pt-pt value I added to the _wpml_import_source_language_code field was empty.

BUT: If I import ALL 4 posts together in the same file -> THEN mapping works. But it does not work when I only want to import the translated posts.

Thanks a lot for your help,
Sebastian

May 14, 2025 at 8:02 pm #17034334

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thanks for the detailed explanation.

I guess importing both languages (updating existing products) is not a suitable workaround for your use case? 🙂

Can you please try the following:
- Run the PT import/refresh
- Don't run WPML > Export and Import
- Run the EN import
- Now run WPML > Export and Import

Best Regards,
Otto

May 14, 2025 at 8:09 pm #17034337

sebastianS-153

Hi Otto,

thanks for the answer.

What you suggested also works, so things get mapped correctly (I already saw thie behaviour yesterday evening):

- Run the PT import/refresh
- Don't run WPML > Export and Import
- Run the EN import
- Now run WPML > Export and Import

Basically I assume WPML here then has the imported items in "cache" and is able to map them.

Is what I am seeing expected (so in my loom)? I just need to know in order to setup our process to then make sure we do not break anything. Or should it normally also work like in your previous message, so that I should be able to import files separately.

Thanks a lot
Sebastian

May 14, 2025 at 8:14 pm #17034340

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hi Sebastian,

Sorry, I wasn't clear in my previous message.

Yes, that's the expected behaviour. You can import separate files, but run the WPML matching process only once. After that, things are cleared and metadata is removed.

The metadata that links the original and translation should be available before running the WPML process (running one or several imports) and it's cleared after.

Best Regards,
Ottor

May 14, 2025 at 8:15 pm #17034344

sebastianS-153

Got it, thanks!

May 14, 2025 at 8:16 pm #17034346

sebastianS-153

Got it, thanks for your support!

May 14, 2025 at 8:17 pm #17034348

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

I am glad it helped.

I am closing the ticket then, if you need anything else don't hesitate to open a new one.

Best Regards,
Otto