WPML Multilingual Plugin Setup for WordPress
WPML (WordPress Multilingual Plugin) is a paid plugin for creating multilingual WordPress sites. It is used on hundreds of thousands of sites and is de facto the standard for serious multilingual projects with WooCommerce support.
WPML Components
WPML consists of several plugins installed separately:
- WPML Multilingual CMS — the core, without which nothing works
- WPML String Translation — translation of theme strings, plugins, widgets
- WPML Translation Management — translation workflows with translator assignment
- WPML Media Translation — separate images for different languages
- WooCommerce Multilingual — support for products, attributes, variations, cart
Minimum set: CMS + String Translation. For an online store, add WooCommerce Multilingual.
Language URL Structure
WPML supports three options:
1. Different subdomains: ru.example.com / en.example.com
2. Subdirectories: example.com/ru/ / example.com/en/
3. Different domains: example.ru / example.com
Subdirectories are the most common option. Configured in WPML → Languages → Language URL format.
Creating Content Translations
Translations are created in two ways:
Manually: in the post editor, a "Translation" block appears with buttons for each language. Clicking "+" or a pencil opens the translation editor with the original and translation side by side.
Via Translation Management: posts are sent to a translation queue, assigned to translators (local or via WPML Translation Services), and returned with translations.
Translating Theme and Plugin Strings
WPML → Theme and Plugins Localization
→ Select theme → Scan for strings
After scanning, all strings appear in String Translation for manual translation or loading via .po/.mo files.
Strings with JavaScript insertion via wp_localize_script are scanned automatically starting with WPML 4.5.
WooCommerce Configuration
After installing WooCommerce Multilingual:
- WPML → WooCommerce Multilingual → Products — translate each product separately or synchronize fields
- Currencies — you can set different currencies for different languages (EUR for German, GBP for English)
- Shipping — shipping methods are translated separately
Translation mapping table: wpml_translations stores trid (translation group id), language_code, element_id (post_id), element_type (post/post_type).
Programmatic Access to Translations
// Get the translated post ID for a specific language
$translated_id = apply_filters( 'wpml_object_id', $original_post_id, 'post', true, 'en' );
// Get current language
$current_language = apply_filters( 'wpml_current_language', null );
// Switch language programmatically
do_action( 'wpml_switch_language', 'de' );
$german_posts = get_posts( [...] );
do_action( 'wpml_switch_language', null ); // restore
Field Synchronization
In WPML → Settings → Custom Fields Translation, you specify what happens to custom post fields when translating:
-
Copy— copy value to translation (for numeric fields, dates) -
Copy once— copy only on initial translation creation -
Translate— field is translated independently -
Ignore— do not copy
ACF fields are determined automatically through integration with ACF.
Common Issues
Duplicate content in search — if the sitemap is generated by Yoast without considering languages. Solution: enable WPML support in Yoast in Yoast SEO → Integrations, or use WPML XML Sitemap.
Empty translations in REST API — when accessing /wp-json/wp/v2/posts, only posts from the current language are returned. To specify language explicitly: add parameter ?lang=en to the request (WPML adds this parameter).
Slow site — WPML adds a JOIN to each WP_Query. On large databases (10k+ posts, 3+ languages), this is noticeable. Solution: indexes on wpml_translations.trid, object caching (Redis/Memcached).
Timeline
Installation and language setup, translation of existing content up to 50 pages — 2–3 business days. WooCommerce store, custom post types, Translation Management setup with translators — 4–6 days.







