I contacted you to have support on how to import posts from a website with standard language = Greek and secondary language = English into a website with standard language = English and secondary language = Greek.
Your answer was the following
Maiya
17 : 45 : 06
Hello Elena,
I understand you're setting up your new site with a different primary language and are encountering an issue where imported Greek posts are still being treated as primary, even though you want English to be primary on the new site. This is a common situation when migrating content with a change in the default language.
The key to resolving this lies in how WPML identifies the original language of your content during the import process. Even though you're using WP All Export and WP All Import with WPML Export and Import, the language relationships from your old site (Greek primary, English secondary) might be carried over in the export file.
Let's ensure your import file correctly tells WPML that English is the primary language on your new site. We'll need to check and potentially adjust two specific columns in your export file before re-importing:
• _wpml_import_language_code: This specifies the language of the content in that row.
• _wpml_import_source_language_code: This indicates the language of the original content. For items in your site's default language (English, in your new site's case), this field should be empty. For translations (Greek posts), this field should point to the source language (English).
•
Here are the steps to correctly import your blog posts with English as the primary language and Greek as the secondary:
1 Prepare Your Export File for the New Language Setup:
◦ Open the CSV or XML file you exported from your old website using a spreadsheet editor (like Google Sheets, Excel, or a text editor).
◦ Locate the columns named _wpml_import_language_code and _wpml_import_source_language_code. If these columns are not present, you may need to manually add them following the guidelines in our documentation on "Preparing XML and CSV Files for Importing Multilingual Data with WPML Export and Import."
◦ For English Posts: Ensure that the _wpml_import_language_code is en and the _wpml_import_source_language_code field is empty.
◦ For Greek Posts (which will be translations of English on your new site): Ensure that the _wpml_import_language_code is el and the _wpml_import_source_language_code is en.
◦ Save your modified file.
2 Delete Previously Imported Posts (Optional but Recommended):
◦ If you've already imported the posts incorrectly, it's best to remove them from your new site to avoid duplicates or orphaned translations. You can usually do this through WP All Import → Manage Imports and deleting the previous import, which also removes the imported items.
3 Import Your Content Using WP All Import:
◦ Go to WP All Import → New Import on your new site.
◦ Upload your modified CSV/XML file.
◦ Follow the WP All Import wizard, mapping your post fields as you normally would. Ensure you map the _wpml_import_language_code and _wpml_import_source_language_code to custom fields if WP All Import doesn't automatically recognize them (usually under the Custom Fields section in Step 3).
◦ Complete the import process.
4 Run WPML Export and Import:
◦ Once the import is complete, navigate to WPML → Export and Import.
◦ Click the Run WPML Import button.
◦ This step is crucial as it tells WPML to process the language information from your import file and correctly assign languages and connect translations based on the _wpml_import_language_code and _wpml_import_source_language_code you set.
After these steps, please check your blog posts in the WordPress admin. English posts should now be editable directly as the primary language, and Greek posts should be correctly linked as their translations, accessible via the Translation Editor or by switching languages in the admin bar.
====
I want to know:
1) should I export and map into import also the field _wpml_import_translation_group?
2) Should I export the oldo posts in two different csv files according to the language?
3) related to question 2: should I import first English csv file, then Greek csv file and after running WPML Export and Import?
الموضوع ”[مغلق] Wp All import with WPML double language“ مغلق للردود الجديدة.