WP All Import plugin allows you to import posts, pages, WooCommerce products, and other custom post types in bulk from CSV files. You can also import content in multiple languages.
How to import your multilingual content:
- Getting Started
- Before Importing
- Prepare Your CSV Files for Importing
- Create Your Taxonomies in WordPress
- How To Import Posts
- How To Import WooCommerce Products
This article also covers:
- Exporting Posts
- Importing a Custom Database Design Into WordPress
- Known Issues with WPML All Import
- Getting Help
Start by installing and activating the following plugins:
- WP All Import plugin
- WPML core plugin
- WPML All Import add-on (available from your WPML Downloads page)
If you want to import WooCommerce products, you will also need WooCommerce Import Add-On Pro.
New to WPML? Check out our Getting Started Guide. It quickly walks you through different translation options you can use.
If selected, WPML’s Translate Everything feature automatically translates all of your site’s current content as well as any new content that you create.
To manually import translations with the WPML All Import plugin, choose to Translate Some of your content. This option gives you the ability to choose which content you want to translate.
Before running an import, make sure to disable the option to “Increase speed by disabling do_action calls in wp_insert_post during import.” When enabled, this option can cause issues during the import process.
To do this, go to All Import → Manage Imports and click on the Settings link under your file. Then:
- Scroll down to the bottom of the page and expand the Configure Advanced Settings section.
- Uncheck the box next to Increase speed by disabling do_action calls in wp_insert_post during import.
- Click on the Save Import Configuration button.
Create a spreadsheet containing your default language post titles and content and save it as either a CSV file or XML file. Give it a meaningful filename, as this will help identify the file from a list later in the process:
Prepare separate spreadsheets for each additional language:
When you import the files later, WP All Import will need a way to match the default language posts to their corresponding translations in the other files.
To do this, you need to specify a unique identifier for each post. Assign an ID number to one of your posts in your default language. Then, use that same ID number for the same post in your secondary language files. By looking at this ID, you can tell which post is the translation of another by finding the same ID number in your files.
For example, in the screenshots above, you can see that, “Hello World!” has a Polish translation of “Witaj świecie!” because they have the same unique identifier.
If you are importing translated posts with taxonomies (categories, tags, or custom taxonomies), you must create the exact same taxonomies in your WordPress site before importing the post files. This can be done in two ways:
- Create the terms manually and translate them. Make sure the terms that you create in both your default and secondary languages match the terms you use in your CSV files exactly. If you have a lot of terms to translate, you can check our guide on translating all taxonomy terms at once.
- Import the terms using WP All Import. To do this, prepare new CSV files to import the taxonomies and their translations. Add the unique identifier column to all CSV files to link each taxonomy term with its translation. You can follow WP All Import’s guide on importing taxonomies, but be sure to set the import language as described in the section later in this article.
Each time you import posts with taxonomies, you need to create the taxonomy terms first, then import the posts. Once the taxonomy terms and translations exist and match the terms in your CSV file, WP Import will be able to set the correct taxonomy for posts you import.
As previously stated, we highly recommend creating your taxonomy terms and translations before importing your CSV files. If you do not create your taxonomies before importing your CSV files, your secondary language taxonomy terms will not be connected as translations of the default language terms. You will need to edit each of your translated taxonomy terms to match them with the correct default language taxonomy term.
To do this:
- Go to Posts → Categories (or whichever taxonomy type you are correcting).
- Switch to your secondary language using the language switcher at the top of the page.
- Edit the taxonomy term you need to fix.
- At the bottom of the page, choose which default language taxonomy term the current term is a translation of.
If your taxonomy terms have the exact same name in the default and secondary languages, the import of the translated terms will not function properly.
Before importing terms with the same name in multiple languages, we recommend renaming the translated terms to something else. After successful import, you can change the translated term name back to the same name as the default language term if needed.
Or, you can add a language code, like “-es” to the end of the taxonomy term in your secondary language. Then, choose the “Set slug manually” option and manually map the slug to the corresponding column in your spreadsheet.
Once your taxonomies and their translations are in place, you are ready to import your CSV files. Be sure to import your default language files first, followed by your secondary language files. We will summarize the steps below. For more detailed documentation, please see WP All Import’s article on how to import files.
To import your default language file:
- Go to WP All Import → New Import, and click Upload a file to upload your default language CSV file. Choose whether you are uploading new or existing items, and what type of element you are importing.
- On the next screen, you can review each row in your CSV file. If it all looks correct, click Continue to Step 3.
- Map your column titles from the right sidebar to the correct fields by dragging and dropping them. Expand the WPML All Import metabox and choose your default language. Then, click Continue to Step 4.
- Map the unique identifier to the correct element in your CSV or XML file. Click Continue to view a summary of your import, then click Confirm & Run Import to import your default language posts.
Repeat the import process with your secondary language file with a few exceptions:
- In the WPML All Import metabox, choose the correct secondary language.
- Expand the Automatic Record Matching to Translate section and select the file that you used to import the default language posts.
- Drag the field that you are using as the unique identifier to the Unique Identifier field. This field and the Unique Identifier field on the next screen needs to be the same as the one you chose during the default language import.
This import will create posts in secondary languages and connect them as the translations of the default language.
Because WP All Import relies on the unique identifier to connect translated posts with their corresponding default language post, you cannot upload the secondary language file to add translations to pre-existing default language content. If you do this, WP All Import will not know which posts the translations belong to.
To add translations when default language content already exists on the site:
- Export your default language content using WP All Export.
- Edit the newly created CSV to add a column for the unique identifier.
- Delete the original content from the site.
- Import the default language CSV file with the unique identifier column. Make sure to import it as New items.
Once the default language file has been imported, you can continue with your secondary language file as previously explained.
WooCommerce Import Add-On Pro is required for importing simple and variable WooCommerce products. Once you have purchased WP All Import, you can find the link to download WooCommerce Import Add-On Pro on your WP All Import downloads page.
If you need to import WooCommerce variable products, there are some additional steps. Follow WP All Import’s tutorial for instructions on how to import variable WooCommmerce products. Don’t forget to add the unique identifier column!
You can then import your translations the same way, paying close attention to the extra considerations as outlined in the tutorial. Be sure to create all your product taxonomy terms and translations before importing your CSV files.
To import products with manually set prices for other currencies, make sure to set the relevant fields in the WooCommerce Add-On section for the default language import. This includes the regular price and sale price.
You also need to add the following custom fields in the default language import in order for the prices to show correctly on the product pages in secondary languages. In our example, we have manually set prices for products in Euros. Hence, we have added the following custom fields:
Depending on the currency you have set prices for, you need to change the suffix of several of the custom fields to match the currency code. To get the currency code:
- Go to WooCommerce → WooCommerce Multilingual.
- Go to the Multi-currency tab and click on the Add currency button.
- Select the currency to get its code.
If you are importing products in more than one language and they all have manually set prices for all other currencies, make sure to add custom fields associated with all the currency suffixes.
WPML and WP All Import do not have an option to export posts from a WordPress installation.
We do not recommend using the standard WordPress option to export content to XML files (Tools → Export). You will have to split those files into many (one for each language) and add an XML element with a Translation Group ID. XML files are not easy to edit, so it can be a lengthy process.
If you want to save a backup of your posts, we recommend using an export plugin like WP All Export. These plugins export CSV files, which make it easier to split files per language and add information about the Translation Group ID.
You can do this manually, or if you are a programmer, you can parse those files in PHP. For every row, you can check the translation of the given post using the wpml_object_id filter.
Migrating from a custom database with different tables into WordPress can be a challenging task. Fortunately, you can accomplish this using Toolset plugins and WP All Import. Check out Toolset’s guide on importing a database into WordPress. The video below illustrates the migration process in details:
If you need help using WPML All Import, visit WPML’s support forum.