WordPress currently does not support a bilingual or multilingual blog out-of-the-box. However, plugins developed by the WordPress community make it easy to create a multilingual blog. The fourth and final phase of the WordPress Gutenberg project will add core implementation for multilingual sites as listed in the WordPress roadmap.
Creating a multilingual blog is basically installing WordPress in more than one language and letting the Plugin switch between them. This includes installing .mo languages files which most Plugins will require you to do manually. For more details, see Installing WordPress in Your Language.
Different types of multilingual plugins
There are a few basic types of multilingual Plugins:
- Manage multilingual posts in one post per language. Translations are then linked together, indicating that one post is the translation of another.
- Store all languages alternatives for each post in the same post.
- Manage translations on the generated page instead of using a post context.
- Link together separate WordPress sites in a network (multisite) installations for each language by pinging back and forth.
One language per post
Multilingual plugins that assign a single language per post will let the user select the post’s language and add translations as new posts (same for pages, tag and categories).
Then, different versions of the same content are linked together to form translation groups. This grouping allows users to switch the display language.
Pros:
- The database contents for posts remain unmodified (easy install and uninstall).
- Everything gets translated by default. If a post includes custom fields, they’re attached to that post, so they are already associated with the language.
- Some plugins use – for theme’s displayed terms – the language files (.mo) delivered with localizable themes. In WordPress, localization is based in GNU gettext technology. So when a single post is in french, plugin switch all the terms of the theme in the same language (here french). The files can be completed with the specific terms of the site (categories titles, widget, links…). No need to re-translate all, just add specific terms and translations in target languages.
- Other plugins that analyze contents (like related posts) keep working correctly.
Cons:
- More complex architecture. The plugin needs to hook to many WordPress functions and filter them so that only contents that matches the language is returned.
- Additional tables are required by some plugins – normally, to hold the translation grouping. Newer plugins likely use a custom taxonomy or post meta fields instead.
- May cause excessive database grow and slow performance as a result. A WooCommerce-based site having a 100,000 products will have 500,000 records after translating to 5 languages. All product metas (could be tens of those per product, and also transients will be duplicated, too, so the database might become huge).
All languages in a single post
Multilingual plugins that hold all the language contents in the same post use language meta tags to distinguish between contents in different languages. When the post is displayed, it’s first processed and only the active language content remains.
Pros:
- Side by side editing is easily implemented.
- Less things to break. There are no additional tables and much fewer things to modify in WordPress.
- The search will find the same post, regardless on which language you used for the keyword.
- Number of records in the database stays the same.
Cons:
- Uninstall can be complicated, as the database needs to be cleaned from multilingual contents.
- Post permalinks may not be translatable.
Manage translations on the generated page
Multilingual plugins that use the content pages generated by WordPress and perform translation on those pages. When any page is displayed on WordPress the plugin (either offline or online) attempts to create a translated version of the page using machine translation. Later on that translation can be manually changed or modified.
Pros:
- Installation is simple and translation for any content on the page is provided.
- Editing the translation can be done with ease.
Cons:
- Automatic translation is not good enough and pages on the site might be badly translated.
- There’s a strong coupling between content and translation, and changes in the original content might break the translation.
Plugins that direct you to external translation services
Those Multilingual plugins are normally used to create a widget that creates a shortcut for using online translation services (such as Google Translate). The content is auto translated on demand by the third party engine.
Pros:
- Installation is simple and translation for any content on the page is provided.
- It is quite clear that the translation process is automated, so the users expectations are lowered.
Cons:
- Automatic translation is not good enough and pages on the site might be badly translated.
- Without the ability to change the translation those plugins limit the ability of the content publisher to provide quality translated content.
Each language in its own WordPress installation
A separate site is created for each language you want to translate into (e.g. in a WordPress Multisite installation). All the sites need to run the same theme and plugin. When a translation is saved source posts get pinged by translation posts and the system keeps a separate table with the translation relationships.
Pros:
- Each language site is a regular WordPress install with regular posts (postmeta and external db is used for translation data)
- If you turn off the plugin the content continues to work fine, albeit without knowledge of its sources/translations.
Cons:
- Separate sites create more management needs which might be undesirable.
Language negotiation
Language negotiation means how to determine the language in which users see the site.
Regardless of the solution for storing multilingual contents, multilingual plugins also need to be able to choose which language to display in.
Normally, the URL indicates the display language. Different URL strategies for encoding language information are:
- Add the language name as a parameter: example.com/?lang=en or example.com/?lang=es
- Add virtual ‘directories’ as language names: example.com/en/ or example.com/es/
- Use different domains for different languages: www.example.com or es.example.com
How to choose the right multilingual solution
Choosing the most suitable multilingual Plugin for your needs will take some time. See the WordPress Plugin Directory for a list of multilingual Plugins.
There is not only one way but a way adapted to the content strategy, the data-model, the number of posts and pages, and the behavior/experience expected by visitors. And for WordPress Network (multisite), a good knowledge of server administration is required.
In any case, installing a multilingual plugin is a big change for any site. It would be a good idea to first create a test site and verify that everything works correctly between all the required plugins and the theme and only then install.
Since many multilingual plugins change the database significantly, doing a database backup is required before experimenting.
Related
Changelog
- 2023-09-14: Removed links to individual plugins
- 2022-10-25: Original content from Multilingual WordPress.