How to import CSV data into WPML multilingual CMS

July 19, 2019

Looking for a way to build a multilingual WordPress website more easily and quickly? Here is a simple solution, WPML to easily build your own WordPress Multilingual website and Ultimate CSV Importer to import WPML Multilingual website data in one single go. Want to know how? Read on…

Import-of-WPML-multilingual-data-from-CSV-Blog-Image

Let’s consider publishing a blog post about Audi Car Q7 in 4 different languages, which also includes a set of Toolset Types Repeatable field group to specify the model variants like mileage, fuel type, and price.

  • Parent Group Name – Audi
  • Repeatable Field Group Name – Models
  • Fields in the Repeatable Field Group – Name, Mileage, Fuel Type, Price, Image

toolset-types-repeatable-field-csv-import

Download the sample CSV, that is used in this post. Click on File -> Download As -> Comma Separated Values as shown in below image

Get-your-sample-csv-file

Import WPML post in 3 different language

Step: 1

  • Choose your CSV URL – You can choose it from 4 different locations.
  • Once upload, choose the post type(i.e Post, Page, Custom Post, WooCommerce, etc.). This example showcases the import of post, so choose Post from the Import Each Record As dropdown.
  • Click on Continue.

wpml-csv-upload

Step: 2

  • Relate your CSV fields with WordPress fields. You can get this done in two ways – Advanced Mapping or Drag and Drop Mapping.
  • In this example, we need to relate – post fields, Toolset Types field, WPML fields.

Step: 3

  • Use the media handling to import images along with the Meta information.

Step: 4

  • Click on Import, this will bring all your CSV content into WordPress.

wpml-data-import

Now you’ve created your own multilingual website. That’s it? Definitely not, you need to make your content ever fresh with periodic updations – updating each and every website content in multiple languages. On hearing this, you may think of your valuable time getting wasted on this.

But what if I told that you can get this done in no time without logging into your WordPress? Yes, you heard it right.

Import Multilingual WPML data without logging into your WordPress

Rather than maintaining all your values in a CSV file, bring all into a Google Sheet and start reflecting all the changes you do in Google Sheet get automatically mirrored in WordPress. Want to how? Read on the post.

    • Navigate to the Upload From URL section in WP Ultimate CSV Importer. Use the Google Sheet URL here and click on Continue.

wpml-data-uploadfromURL

    • Now choose the post type from Import Each Record As dropdown and click on Continue.
    • Relate your CSV and WordPress fields. Once save your mapping template(Saven Mapping template is mandatory for this) – Enable the checkbox, add the template name and click on continue. The template will be saved automatically once you’ve navigated to the next section.

wpml-import-mapping-template

    • In the 4th step, enable the Do you want to schedule this import? Checkbox. Choose the Date, Frequency and Time to run the import automatically at the back end.
    • Finally, click on Schedule.

wpml-data-scheduled-import

Once done, you can just make your changes in Google Sheets, it will automatically get reflected in your website without any manual intervention.

How to prepare your CSV file?

You can prepare your own CSV based on your requirements. The CSV values are needed to be in the standard WordPress format. To know more about the CSV values, refer to our CSV Importer user guide. Let’s start with adding the header fields,

  • post_title, post_content, post_excerpt, post_date, post_category, post_tag, post_author, post_slug – Basic post fields.
  • relation_slug – Add the Repeatable group slug. Generally, the slug is automatically generated as you enter your group name. For multiple Repeatable Field Group mention the slug values in Comma(,) separation.
  • car_name, car_mileage, car_fueltype, car_price, car_image – Fields used in Toolset Types Repeatable Field Group.

To import this post in multiple languages,

  • language_code – Specify your language code here.

To relate your translated post to your default post,

  • translated_post_title – Mention the post title name.

toolset-types-repeatable-field-wpml-csv

Now let’s add the values.

  • post_title, post_content, post_excerpt, post_author, post_slug – Add you own text values here.
  • post_date – Follow the default WordPress format yyyy/mm/dd
  • post_category – Mention your category name.
    • Here I’m going to choose two different categories(i.e. Multiples categories – Car, Audi) → Mention these values using “|” separator. So CSV Value is Car|Audi
    • And there is also a nested category Q7 under the category Audi. Mention use a hyphen and greater than symbol (->) – Audi->Q7. Learn more about post category import.
  • post_tag – Mention the tag name. To add multiple tags, use comma(,) separator → Car,Audi,Q7
  • relation_slug – You can get this from your Toolset Types Plugin.
  • Repeatable field Group field values – Use the exclamatory(!) symbol.
    • car_name – Q7 45 TDI Quattro Technology!Q7 45 TDI Design Edition!Q7 40 TFSI Quattro Premium Plus!Q7 40 TFSI Quattro Technology
    • car_mileage – 14.75!14.75!13.55!13.55
    • car_fueltype – Diesel!Diesel!Petrol!Petrol
    • car_price – Rs.85.18L!Rs.81.99L!Rs.73.73L!Rs.81.0L
    • car_image – image_url!image_url!image_url!image_url
  • language_code and related_post_title – add your language code and parent post title of your translated post.

That’s it. It’s time to import. Happy Importing!

Hope you find this article useful, let us know your thoughts and comments via email – [email protected] or in the comments section below.