Docs

Import WPML translations from CSV / XML

Import WP’s WPML add-on extends Import WP and allows you to easily import WPML translations to post types from any xml or csv file.

Import WPML translations from XML or CSV files

The Import WP WPML add-on adds a new section to the “Template Fields” step of the import creation page labelled “WPML”, by default all WPML fields are hidden, but can be enabled via the Enable Fields button shown at the bottom of the section.

The “Language” field is used to set the current translation language of the object being imported to WPML, this can be populated via the dropdown containing a list of all active languages, or can be dynamically populated via a value from the CSV or XML file.

The “Translation” field is used to connect translations together, this can be linked using the Post ID, Post Slug, Post Name, or referencing a value in your CSV or XML file.

Import WPML translations to posts, pages and custom post types.

When importing WPML custom post type translations make sure you have enabled the custom post type to allow translations in WPML To enable the custom post type for translating, go to “WPML > Settings > Post Type Translation”.

The following CSV example shows the minimum columns required to import WPML translations into WordPress posts with translated title and content fields, the important columns to note are the language and translation columns.

IDTitleContentLanguageTranslationTranslation ID
1Page oneExample page one contenten
2Page unExemple de contenu de la première pagefrPage one1
3Pagina unoEsempio di contenuto della prima paginaitPage one1
4Page twoExample page two contenten
5Pagina dueEsempio di contenuto della seconda paginaitPage two4
6Page deuxExemple de contenu de la page deuxfrPage two4
This sample file is included in the plugin or downloaded from here

The “Language” column uses the 2-letters ISO 639-1 code and is used to set the current posts language while also being used as a reference in the translation field.

Setting the language and translation fields on the “WPML” Section, setting the “Translation Field Type” to “Name”, as the “Translation” column in this example references a post by its title/name.

Filling out the rest of the post template fields, setting the title, content and post status to the relevant CSV columns allows the translations to be created and referenced during the import.

Using the default permissions and running the importer, you should see the following available posts, each showing with their related translations that can be edited via the pencil icon under its flag.