You installed a beautiful theme, switched the WordPress theme language to Spanish, German or Arabic, and half the buttons still say “Read More” and “Add to cart.” Or you need the whole site in three languages, with translated URLs that rank in each country. Those are two different jobs, and picking the wrong plugin for the job is the most common reason people struggle to translate WordPress themes.
This guide puts the three most-used tools side by side: Loco Translate (free file-based string editor), WPML (premium all-in-one multilingual suite) and Polylang (freemium multilingual plugin). You will see exactly what each one translates, what it costs, how it affects page speed and server resources, and how to set up each one step by step, with working code for developers who want to translate without a plugin.
1. Introduction: Why Translate Your WordPress Theme?
What is WordPress theme translation?
WordPress theme translation means replacing the fixed text that a theme developer wrote into the template files β labels such as “Search⦔, “Leave a comment”, “Posted by”, “Previous post”, “Out of stock” β with text in another language. A well-coded theme never prints those words directly. It wraps them in gettext functions like __() and esc_html_e() and tags each one with a text domain. WordPress then looks up a matching translation file for the site language and swaps the words at runtime.
That process has two official names you will see in documentation:
- Internationalization (i18n) β the developer’s job: preparing code so it can be translated (wrapping strings, adding a text domain, shipping a
.pottemplate). - Localization (l10n) β the translator’s job: producing
.po,.mo(and in modern WordPress,.l10n.php) files for each locale such ases_ES,de_DEorar.
The WordPress developer handbook explains both in its theme internationalization guide, which is the standard every translation-ready WordPress theme should follow.
Why translate WordPress themes into multiple languages?
Because most of the web is not English. W3Techs’ content-language survey puts English at roughly half of all websites, with Spanish, German, Japanese and French next in line. If your theme only speaks English, every other visitor meets a mixed-language interface β and mixed-language pages hurt trust, conversions and local search rankings.
Concrete benefits of translating a theme or full website:
- Better user experience β buttons, forms, cart and checkout labels appear in the visitor’s own language.
- Higher conversions β shoppers abandon fewer carts when shipping notices and error messages are understandable.
- Local SEO reach β each language version can rank for its own keywords when paired with hreflang tags.
- Admin comfort β your editors and clients can work in a dashboard in their native language.
- RTL markets β an RTL (right-to-left) supported WordPress theme opens Arabic, Hebrew, Persian and Urdu audiences.
Difference between theme translation and website translation
This is the single concept every competitor glosses over, and it decides which plugin you need:
- Theme translation = one site, one language, different from the theme’s original language. Example: a French bakery runs a single French site on an English theme. Loco Translate alone solves this.
- Website translation = one site, several languages at once, with a switcher. Example: a hotel serving English, German and Japanese guests. That needs WPML or Polylang, and usually still relies on
.mofiles for Layer 1.
Overview of Loco Translate, WPML, and Polylang
Loco Translate is a free in-dashboard editor for WordPress .pot .po .mo language files. WPML is a commercial suite that translates everything β content, strings, WooCommerce, SEO β from one interface. Polylang is a free multilingual plugin with paid Pro and WooCommerce upgrades; it manages translated content and URLs but leaves theme .po files to tools like Loco. Many professional builds pair Polylang + Loco Translate, and that combination is covered in detail below.
2. Loco Translate vs. WPML vs. Polylang: Quick Comparison
| Criteria | Loco Translate | WPML | Polylang |
|---|---|---|---|
| Main purpose | Edit theme/plugin language files | Full multilingual website | Full multilingual website |
| Price | Free (optional paid API plans) | β¬39 / β¬99 / β¬199 per year | Free; Pro β¬99/yr; Business Pack β¬139/yr |
| Active installs (WordPress.org) | 1M+ | Not listed (sold on wpml.org) | 900K+ |
| Theme string translation | β Native (.po/.mo) | β String Translation | β Registered strings only |
| Posts, pages, products | β | β | β |
| Menus & widgets | β | β | β |
| Language switcher | β | β | β |
| hreflang & language URLs | β | β | β |
| Automatic / AI translation | β Via API keys (DeepL, Google, Microsoft, OpenAI) | β Built-in AI credits (CMS & Agency) | β DeepL in Pro |
| WooCommerce | Strings only | β Included + multi-currency | β Paid add-on |
| Front-end overhead | None (writes files) | Highest | Low |
| Learning curve | Easy | Moderate | Easyβmoderate |
| Best for | Single-language sites & fixing strings | Agencies, large stores, teams | Blogs, business sites, budget stores |
Main features and capabilities
Loco Translate is laser-focused: it scans a theme or plugin, extracts every translatable string, and gives you a side-by-side editor that saves compiled files. WPML and Polylang instead create linked copies of each post per language, add a language taxonomy (Polylang) or translation tables (WPML), and rewrite URLs per language.
Free vs. premium features
Loco Translate’s core is fully free; paid plans only add higher quotas for its built-in translation API integrations. Polylang’s free edition already translates posts, pages, categories, tags, menus and widgets and includes a switcher and hreflang. Polylang Pro adds translated slugs, shared slugs, content duplication, XLIFF export and DeepL machine translation. WPML has no free tier; the entry Multilingual Blog plan is limited to one production site, while the CMS plan unlocks the Advanced Translation Editor, page-builder support and AI translation words.
Ease of use and setup
Loco takes about two minutes: install, pick theme, add language, translate. Polylang’s setup wizard asks for languages and a default, then you translate by clicking “+” icons in the post list. WPML’s wizard is longer (site key registration, URL format, switcher options, translation mode) but guides you well.
Theme and plugin compatibility
Any theme that uses gettext and a correct text domain works with Loco. For content-level compatibility, theme and plugin authors ship a wpml-config.xml file that tells WPML and Polylang which custom fields, shortcodes and options to translate β so “WPML compatible WordPress theme” usually also means “Polylang compatible theme.”
Translation workflow comparison
File-based workflow (Loco)
- Translate once per locale
- Output: .po + .mo (+ JSON for JS)
- Site shows one language at a time
- Zero database growth
Content-based workflow (WPML/Polylang)
- Duplicate every post per language
- Strings stored in database tables/options
- Visitors switch languages live
- Database grows with each language
3. What Is Loco Translate?
Loco Translate is a free plugin by Tim Whitlock that lets you edit WordPress translation files right inside the browser. On WordPress.org it shows more than one million active installations and a 4.8-star rating, which makes it the most popular dedicated tool for Loco Translate WordPress theme localization.
Key features of Loco Translate
- Built-in PO editor with search, filters, fuzzy flags and keyboard shortcuts.
- Extracts strings from theme and plugin source code to create a fresh
.pottemplate. - Compiles
.mofiles automatically on save, plus JSON files for JavaScript (block editor) strings. - Protected “Custom” language directory so updates don’t erase your work.
- PO file backups with diff and restore.
- Machine translation through your own API keys (DeepL, Google, Microsoft, OpenAI and others).
- Works for WordPress core, themes, child themes and plugins.
How Loco Translate works
Loco reads the theme’s text domain and source files, compares them against the template, and lets you fill in a translation per string. When you click Save, it writes a .po (human-readable) and .mo (machine-readable) file to one of three locations:
| Location | Path | Survives updates? |
|---|---|---|
| Custom (recommended) | wp-content/languages/loco/themes/ |
β Yes |
| System | wp-content/languages/themes/ |
β May be overwritten by official language packs |
| Author | wp-content/themes/your-theme/languages/ |
β Deleted on theme update |
Pros and cons of Loco Translate
Pros
- 100% free core, no site limits
- No front-end performance cost
- Translates themes, plugins and core
- No FTP or Poedit needed
- Perfect companion to Polylang
Cons
- Cannot translate posts, pages or menus
- No language switcher or hreflang
- Useless for hardcoded strings
- “Author” location loses edits on update
- Requires write access to wp-content
Supported translation file formats
| Format | What it is | Who uses it |
|---|---|---|
.pot |
Portable Object Template β master list of source strings, no translations | Theme developers ship it |
.po |
Portable Object β editable text file with source + translation pairs | Translators, Loco, Poedit |
.mo |
Machine Object β compiled binary WordPress reads | WordPress runtime |
.json |
Script translations for JavaScript / blocks | Block editor, wp_set_script_translations() |
.l10n.php |
PHP array translations, cached by OPcache (WordPress 6.5+) | WordPress core prefers it when present |
When should you use Loco Translate?
- Your site uses one language that differs from the theme’s language.
- A few labels remain in English after you change WordPress site language.
- You want to rename default text (“Add to cart” β “Buy now”) without code.
- You run Polylang and need theme/plugin strings in every language.
- You build themes and need to generate a
.potfile for distribution.
4. What Is WPML?
WPML (WordPress Multilingual) is a premium plugin suite from OnTheGoSystems that turns a single WordPress install into a fully multilingual site. It’s sold directly on wpml.org rather than WordPress.org.
Key features of WPML
- Translate posts, pages, custom post types, taxonomies, menus and widgets.
- String Translation module for theme, plugin and admin texts (site title, Customizer options, widget text).
- Advanced Translation Editor with translation memory and glossary (CMS and Agency plans).
- AI translation credits included in CMS (22,500 words) and Agency (45,000 words), plus DeepL, Google and Microsoft options.
- WooCommerce Multilingual & Multicurrency: products, variations, attributes, cart, checkout, emails and per-language currencies.
- Language switcher in menus, widgets, footer or via shortcode/block.
- Automatic hreflang, translated slugs, and integration with Yoast, Rank Math and other SEO plugins.
- Translation management for teams and professional translation services.
How WPML handles multilingual websites
WPML stores each translation as its own post linked to the original through its own database tables. Theme and plugin strings can come either from .mo files or from WPML’s String Translation tables. URLs can use a directory (/de/), a separate domain per language, or a ?lang=de parameter.
Theme and plugin translation capabilities
Under WPML β Theme and plugins localization, WPML scans your active theme and plugins and imports their strings into WPML β String Translation. You can then translate them manually, send them for AI translation, or tell WPML to keep using existing .mo files. Developers can expose dynamic options (logo text, footer copyright, Customizer fields) with wpml-config.xml β covered in the code section below.
Automatic and manual translation options
WPML offers three translation modes: translate everything automatically (AI translates new content as you publish), translate some (you pick items and choose machine or manual), and professional translation through integrated agencies. Manual editing works in the Advanced Translation Editor or the classic WordPress editor. For brand-critical pages, review machine output before publishing.
Pros and cons of WPML
Pros
- Translates every layer from one dashboard
- Best-in-class WooCommerce + multi-currency
- AI translation included in CMS/Agency
- Strong page-builder support (Elementor, Divi, Gutenberg)
- Team workflows and translation services
Cons
- No free plan
- Heaviest on database and memory
- Blog plan lacks page-builder support
- Annual renewal needed for updates
- More settings to learn
5. What Is Polylang?
Polylang is a freemium multilingual plugin from WP SYNTEX. Its official site reports more than 900,000 active installations with a 4.7/5 rating. It integrates tightly with the WordPress admin and uses a language taxonomy rather than its own translation tables.
Key features of Polylang
- Unlimited languages, including RTL languages.
- Translate posts, pages, media, categories, tags, custom post types, menus and widgets.
- Language switcher as a menu item, widget or block.
- URL modes: language set from content, directory (
/fr/), subdomain or separate domain. - Automatic hreflang tags and integration with Yoast SEO and other SEO plugins.
- String translation screen for site title, tagline, widget titles and strings registered by themes/plugins.
- Reads
wpml-config.xml, so many WPML-ready themes work out of the box.
How Polylang handles multilingual content
Each translation is a normal WordPress post with a language term attached, and translations are linked as a group. Because it reuses core taxonomies, Polylang adds very little query overhead β a meaningful advantage on shared hosting.
Theme and plugin translation support
Here is the nuance: Polylang does not translate gettext strings inside theme files. It relies on the standard .mo files for each language, so for “Read more” or “Add to cart” you either use the theme’s bundled translations, download them from translate.wordpress.org (GlotPress), or create them with Loco Translate. Polylang’s own Languages β Translations screen handles only dynamic strings β those stored in the database and registered with pll_register_string() or wpml-config.xml.
Free vs. Polylang Pro
| Feature | Polylang (free) | Polylang Pro (β¬99/yr) | Business Pack (β¬139/yr) |
|---|---|---|---|
| Posts, pages, menus, widgets | β | β | β |
| Language switcher & hreflang | β | β | β |
| Translated / shared URL slugs | β | β | β |
| DeepL machine translation | β | β | β |
| XLIFF import/export | β | β | β |
| Full Site Editing (block theme) templates | Limited | β | β |
| WooCommerce shop translation | β | β (add-on β¬99/yr) | β Included |
| Premium support | Forum | β | β |
Renewals of Polylang licences currently get a 50% discount. Check Polylang’s pricing page for multi-site licences.
Pros and cons of Polylang
Pros
- Generous free version, unlimited languages
- Lightweight, no custom tables
- Feels native in the WordPress admin
- Reads wpml-config.xml
- Cheap renewals
Cons
- Theme .po strings need Loco or Poedit
- WooCommerce costs extra
- No AI translation in free tier
- Free support is forum-only
- Fewer team-workflow tools than WPML
6. Loco Translate vs. WPML vs. Polylang: Key Differences
Theme and plugin string translation
Winner: Loco Translate (free) / WPML (all-in-one). Loco edits the actual .po/.mo files, so translations load the fastest possible way and stay independent of any multilingual plugin. WPML’s String Translation can do the same job and also handles database strings. Polylang only handles registered dynamic strings.
Page and post translation
Winner: tie between WPML and Polylang. Both create linked translations; WPML adds a side-by-side editor and translation memory, Polylang keeps the familiar block editor. Loco can’t translate content.
Menu and widget translation
WPML can sync menus across languages automatically. Polylang lets you assign a separate menu per language to each theme location. Loco: not applicable.
WooCommerce translation support
Winner: WPML. WooCommerce Multilingual & Multicurrency is included at no extra cost and supports per-language currencies and payment gateways. Polylang needs the β¬99 Polylang for WooCommerce add-on (or the β¬139 Business Pack). Loco Translate is still useful for WooCommerce’s own strings and for shop plugins β new to the platform? Start with how WooCommerce works.
Automatic translation capabilities
WPML ships AI credits with CMS and Agency plans. Polylang Pro connects to DeepL. Loco Translate connects to several providers through your own API keys, and third-party add-ons extend it further. All three still need a human review for legal text, prices and slogans.
Multilingual SEO features
| SEO feature | Loco | WPML | Polylang free | Polylang Pro |
|---|---|---|---|---|
| hreflang tags | β | β | β | β |
| Language subdirectories/domains | β | β | β | β |
| Translated slugs | β | β | β | β |
| Translated SEO title/meta | β | β | β (with SEO plugin) | β |
| Multilingual XML sitemap | β | β (via SEO plugin) | β (via SEO plugin) | β |
Google’s guidance on localized versions of your pages explains why hreflang matters: it tells search engines which URL to show each language audience and avoids duplicate-content confusion.
Translation file management
Loco gives you direct control over files, backups and sync with the POT template. WPML can import .mo files into its tables or keep loading them from disk. Polylang leaves files entirely to WordPress core and translators.
Pricing and licensing
| Plan | Price / year | Sites | Highlights |
|---|---|---|---|
| Loco Translate | Free | Unlimited | Full PO editor; paid plans only raise API quotas |
| Polylang | Free | Unlimited | Content, menus, switcher, hreflang |
| Polylang Pro | β¬99 | 1 | Slugs, DeepL, XLIFF, FSE, support |
| Polylang Business Pack | β¬139 | 1 | Pro + Polylang for WooCommerce |
| WPML Multilingual Blog | β¬39 | 1 live + 3 dev | Basic translation, no page builders |
| WPML Multilingual CMS | β¬99 | 3 live + 9 dev | Advanced editor, page builders, 22,500 AI words |
| WPML Multilingual Agency | β¬199 | Unlimited | Everything, 45,000 AI words |
7. Performance & Resource Usage: Which Plugin Is Lightest?
Translation plugins run on every page load, so they deserve the same scrutiny you give caching or WordPress performance plugins. Here is how the three compare when you monitor resource usage with a tool like Query Monitor.
- Loco Translate only runs in the dashboard. Visitors are served by WordPress core reading
.moor.l10n.phpfiles, so you can even deactivate Loco after translating. - Polylang adds a language filter to queries via taxonomies β a small, predictable cost.
- WPML joins its own translation tables and, if String Translation is active, looks up strings in the database. On large sites, a persistent object cache such as Redis Object Cache makes a visible difference.
- WordPress 6.5+ performant translations: core now prefers
.l10n.phpfiles, which load faster and use less memory than.mofiles. Read the Make WordPress Core announcement for details.
How to identify a slow translation plugin:
- Install Query Monitor and open a translated front-end page.
- Check Queries by Component β compare the time and count attributed to WPML or Polylang.
- Open Languages to see which text domains and files loaded, and whether any are missing.
- Compare total page generation time and peak memory with the plugin active vs. inactive on staging.
- Run a front-end speed test before and after; our guide on improving WordPress page speed walks through the full process.
8. How to Translate a WordPress Theme Using Loco Translate
Step 1: Install and activate Loco Translate
Go to Plugins β Add New, search “Loco Translate”, click Install Now and Activate. A new Loco Translate menu appears in the sidebar. Before you start, set the target language under Settings β General β Site Language (or per user in Profile β Language if you only want the dashboard translated).
Step 2: Select your WordPress theme
Open Loco Translate β Themes and click your active theme. If you use a child theme, translate the parent theme’s text domain β that’s where most strings live β unless your child theme adds its own strings. Loco shows existing languages, their completion percentage and the template (.pot) status. If no template exists, click Create template; Loco will extract strings from the source code.
Step 3: Choose your target language
Click New language. Pick the WordPress language (for example Spanish (Spain) β es_ES) and, critically, choose the Custom location (languages/loco/themes/). Then click Start translating.
Tip: If the theme already ships a Spanish translation and you only want to change a few words, choose Copy from existing so you don’t start from zero.
Step 4: Translate theme strings
Select a source string, type the translation in the bottom box and move to the next with Ctrl + Enter. Pay attention to:
- Placeholders like
%s,%dor%1$sβ keep them exactly, though you may reorder numbered ones. - Plural forms β Loco shows one tab per plural form required by the language (Arabic has six, Polish three).
- Context β the same English word may appear twice with different context labels (“Post” as noun vs. verb).
- HTML tags in strings β keep them intact.
Short on time? Click Auto to machine-translate untranslated strings via a configured API, then proofread.
Step 5: Save and generate translation files
Click Save. Loco writes my-theme-es_ES.po and my-theme-es_ES.mo (plus JSON files if the theme has JavaScript strings). When the theme gets new strings after an update, open the file and click Sync to merge them from the template.
Step 6: Test your translated theme
- Clear your page cache and any CDN cache.
- Visit the front end in a private window and check headers, footers, 404 page, search results, comments and WooCommerce cart/checkout.
- Use Query Monitor’s Languages panel to confirm the right
.mofile loaded. - Still English? Jump to troubleshooting.
9. How to Translate a WordPress Website Using WPML
Step 1: Install and configure WPML
Buy a plan on wpml.org, download the OTGS Installer (WPML plugin), upload it via Plugins β Add New β Upload, activate and register your site key. Install the core WPML Multilingual CMS plus String Translation; add WooCommerce Multilingual & Multicurrency for shops.
Step 2: Set your default and additional languages
The setup wizard asks for the content’s current language and the languages you want to add. Then choose a URL format β language directories (example.com/de/) are the most SEO-friendly and easiest to host.
Step 3: Translate theme strings
Go to WPML β Theme and plugins localization, select your theme and click Scan selected themes for strings. Open WPML β String Translation, filter by your theme’s text domain, and translate. For Customizer options or theme settings stored in the database, the theme needs a wpml-config.xml (example in the developer section) β then those values appear under the admin_texts domain.
Step 4: Translate pages, posts, and menus
In WPML β Translation Management, select content and choose Translate automatically or Translate myself. Menus are handled in WPML β WP Menus Sync, which copies menu structure to every language using the translated pages.
Step 5: Configure language switchers
Under WPML β Languages β Language switcher options, add a switcher to a menu location, a widget area or the footer. Choose flags, native names or both β and use native language names (“Deutsch”, not “German”) for clarity.
Step 6: Optimize multilingual SEO
- Confirm hreflang tags appear in the page source of each language.
- Translate SEO titles and meta descriptions in your SEO plugin per language.
- Translate slugs so URLs contain local keywords.
- Submit each language sitemap in Google Search Console.
10. How to Translate a WordPress Website Using Polylang
Step 1: Install and activate Polylang
From Plugins β Add New, search “Polylang”, install and activate. Deactivate any other multilingual plugin first to avoid conflicts. The setup wizard opens automatically.
Step 2: Configure website languages
Add your languages in the wizard (or later at Languages β Languages). Set the default language and assign existing content to it with the prompt Polylang shows.
Step 3: Translate theme strings
Two parts, and this is where most tutorials stop short:
- Static gettext strings (“Read more”): install Loco Translate and create a
.po/.mofile for each Polylang language. Polylang switches the locale per page, so WordPress loads the matching file automatically. - Dynamic strings (site title, tagline, widget titles, Customizer text): go to Languages β Translations. If a theme option is missing, the theme author must register it with
pll_register_string()or awpml-config.xml.
Step 4: Create translated pages and posts
In Pages or Posts, click the οΌ icon in a language column. Polylang opens a new linked draft in that language; write or paste the translation and publish. Repeat for categories and tags.
Step 5: Set up language switchers
Go to Appearance β Menus, open Language switcher in the left panel and add it to your menu, or use the Language Switcher widget/block. In block themes, insert the switcher block into the header template part.
Step 6: Configure multilingual URLs
Open Languages β Settings β URL modifications. The directory option (/fr/) is best for most sites. Optionally hide the language code for the default language. Polylang Pro lets you translate slugs or share the same slug across languages.
11. How to Translate a WordPress Theme Without a Plugin (Developer Guide)
If you prefer zero plugins, you can translate a WordPress theme without a plugin using Poedit or WP-CLI, plus a few lines of PHP. This section also shows theme developers how to make a theme translation-ready.
Make strings translatable (i18n)
<?php
// Simple string
echo esc_html__( 'Read more', 'my-theme' );
// Echo directly, escaped
esc_html_e( 'Search results', 'my-theme' );
// Placeholder with translator comment
/* translators: %s: author name */
printf( esc_html__( 'Posted by %s', 'my-theme' ), esc_html( get_the_author() ) );
// Plurals
printf(
/* translators: %d: number of comments */
esc_html( _n( '%d comment', '%d comments', $count, 'my-theme' ) ),
(int) $count
);
// Context for ambiguous words
echo esc_html_x( 'Post', 'verb: publish content', 'my-theme' );
Load the theme text domain
The WordPress theme text domain must match the theme folder slug and the Text Domain: header in style.css. Since WordPress 6.7, translations should not be triggered before the init hook, so register them there:
<?php
// functions.php
add_action( 'init', function () {
load_theme_textdomain( 'my-theme', get_template_directory() . '/languages' );
} );
Generate POT, PO, MO, JSON and PHP files with WP-CLI
The WP-CLI i18n commands are the professional way to produce files. WP-CLI i18n make-pot scans your code; the other commands compile translations:
# 1. Create the template from theme source
wp i18n make-pot wp-content/themes/my-theme wp-content/themes/my-theme/languages/my-theme.pot
# 2. Copy and translate (in Poedit or any editor)
cp my-theme.pot my-theme-es_ES.po
# 3. Compile binary MO files
wp i18n make-mo wp-content/themes/my-theme/languages
# 4. Compile JSON for JavaScript/block strings
wp i18n make-json wp-content/themes/my-theme/languages --no-purge
# 5. Compile fast PHP translation files (WordPress 6.5+)
wp i18n make-php wp-content/themes/my-theme/languages
Child theme language files (override parent translations safely)
Never edit translation files inside the parent theme β updates will wipe them. Put your own files in a WordPress child theme and load them before the parent’s, because the first loaded translation for a string wins:
<?php
// child-theme/functions.php
add_action( 'init', function () {
$locale = determine_locale();
$mofile = get_stylesheet_directory() . "/languages/parent-theme-{$locale}.mo";
if ( file_exists( $mofile ) ) {
load_textdomain( 'parent-theme', $mofile );
}
// Strings added by the child theme itself
load_child_theme_textdomain( 'my-child-theme', get_stylesheet_directory() . '/languages' );
}, 5 );
Register dynamic strings for Polylang
<?php
// Register the Customizer value once (admin side)
add_action( 'init', function () {
if ( function_exists( 'pll_register_string' ) ) {
pll_register_string( 'footer_copyright', get_theme_mod( 'footer_copyright', '' ), 'My Theme' );
}
} );
// Output the translated value in the template
$text = get_theme_mod( 'footer_copyright', '' );
echo esc_html( function_exists( 'pll__' ) ? pll__( $text ) : $text );
Register dynamic strings for WPML
<?php
do_action( 'wpml_register_single_string', 'My Theme', 'Footer copyright', $text );
echo esc_html( apply_filters( 'wpml_translate_single_string', $text, 'My Theme', 'Footer copyright' ) );
Translate Customizer options with wpml-config.xml (works with WPML & Polylang)
<wpml-config>
<admin-texts>
<key name="theme_mods_my-theme">
<key name="footer_copyright" />
<key name="header_cta_label" />
</key>
</admin-texts>
<custom-fields>
<custom-field action="translate">subtitle</custom-field>
</custom-fields>
</wpml-config>
Place the file in the theme root. This is how you solve customizer options translation for any multilingual setup.
Add RTL support
For an RTL supported WordPress theme, ship an rtl.css file in the theme root β WordPress loads it automatically when the site language is right-to-left. You can also branch in PHP:
<?php
if ( is_rtl() ) {
wp_enqueue_style( 'my-theme-rtl', get_template_directory_uri() . '/rtl.css', array(), '1.0' );
}
FSE block theme translation
In FSE block themes, text inside .html templates cannot be translated by gettext. Move user-facing text into PHP block patterns (in /patterns) and wrap it with esc_html_e(). theme.json labels such as style variation titles are picked up by wp i18n make-pot. If you’re choosing between architectures, see our breakdown of block themes vs. classic themes.
Hardcoded theme strings translation
If a theme prints echo 'Read more'; without gettext, no plugin can translate it. Options: ask the developer to fix it, override the template in a child theme with a wrapped string, or as a last resort use the gettext filter for strings that are wrapped but with the wrong domain:
<?php
add_filter( 'gettext', function ( $translated, $text, $domain ) {
if ( 'wrong-domain' === $domain && 'Read more' === $text ) {
return __( 'Read more', 'my-theme' );
}
return $translated;
}, 10, 3 );
hreflang output example
WPML and Polylang add these automatically; for custom builds, this is what search engines expect in the <head>:
<link rel="alternate" hreflang="en" href="https://example.com/about/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/sobre-nosotros/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/ueber-uns/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/about/" />
12. Loco Translate vs. WPML vs. Polylang: Which Is Best for Different Needs?
| Need | Best choice | Why |
|---|---|---|
| Best for translating WordPress themes | Loco Translate | Native .po/.mo editing, free, no runtime cost |
| Best for translating plugins | Loco Translate | Same workflow for any plugin text domain |
| Best for multilingual websites | WPML (budget: Polylang) | Translates every layer from one place |
| Best for WooCommerce stores | WPML CMS | Shop translation and multi-currency included |
| Best free translation solution | Polylang + Loco Translate | Full multilingual site for β¬0 |
| Best option for professional/agency websites | WPML Agency | Unlimited sites, AI credits, team workflows |
13. WordPress Theme Translation Best Practices
Use translation-ready WordPress themes
On WordPress.org, filter themes by the Translation Ready feature tag. For premium themes, check that a .pot file ships in /languages and that the theme lists WPML/Polylang compatibility. All aThemeArt themes follow core i18n rules β The9 Store Pro, for example, is a translation-ready WooCommerce theme that works with Loco Translate, WPML and Polylang. Browse more options in our list of multilingual WordPress themes.
Understand POT, PO, and MO files
POT is the blank template, PO is your editable translation, MO is the compiled file WordPress reads. Edit only PO files and recompile; never hand-edit MO files.
Use the correct text domain
The text domain in every gettext call must match the theme slug and the Text Domain header. A single mismatch makes strings invisible to Loco and WPML.
Follow WordPress internationalization standards
Escape translated output, add translator comments for placeholders, avoid concatenating sentences, and never put variables inside __(). Our checklist of WordPress theme coding standards covers these rules in more depth.
Avoid modifying original theme files
Overrides belong in a child theme or Loco’s Custom directory, never in the parent theme folder.
Store translation files safely
Keep a copy of your .po files in version control or your backup plugin. Loco’s built-in backups help, but an off-site copy is safer.
Test translations after theme updates
Updates add, change and remove strings. After every update, open Loco and click Sync, then spot-check key pages. See our guide on how to upgrade a WordPress theme safely for a full update routine.
14. Common WordPress Theme Translation Problems and How to Fix Them
Theme strings are not appearing in Loco Translate
The theme has no .pot file or uses an unexpected text domain. In Loco, open the theme and click Create template, or go to the theme’s Advanced tab and set the correct text domain and source folders. If strings still don’t appear, they’re hardcoded.
Translation files are not loading
Check the file name: it must be {text-domain}-{locale}.mo in Loco/System locations (e.g. my-theme-es_ES.mo) and just {locale}.mo inside the theme’s own /languages folder. Also confirm the site or user language actually matches the locale.
“_load_textdomain_just_in_time was called incorrectly” notice
Since WordPress 6.7, this notice means a theme or plugin triggers translations before the init hook. Move load_theme_textdomain() and any early __() calls into an init callback, or update the offending plugin. The WooCommerce team’s developer advisory on translation loading explains the change.
Translated text is not displaying
Clear page, object and CDN caches. With WPML, check that String Translation isn’t holding an older, empty translation that overrides the .mo file. With Polylang, confirm a .mo file exists for every active language.
Incorrect text domain
Search the theme for the domain used in gettext calls (grep -r "__(" wp-content/themes/my-theme). If the theme mixes domains, translate both in Loco or report the bug to the developer.
Missing or outdated MO files
Re-save the PO in Loco or run wp i18n make-mo. If a stale .l10n.php sits next to the MO, WordPress loads the PHP file first β regenerate it with wp i18n make-php or delete it.
Translation changes disappear after updates
Your files were saved in the theme folder (Author location). Move them to Loco’s Custom location or a child theme, as shown above.
Character encoding and special character issues
Make sure the PO header contains Content-Type: text/plain; charset=UTF-8, save files as UTF-8 without BOM, and confirm your database uses utf8mb4. Garbled accents (“ΓΒ©”) usually mean a non-UTF-8 save.
15. Frequently Asked Questions (FAQs)
Is Loco Translate better than WPML?
They solve different problems. Loco Translate is better and free for translating theme and plugin strings on a single-language site. WPML is better when you need a multilingual website with a language switcher, translated content, WooCommerce and SEO.
Can I translate a WordPress theme without a plugin?
Yes. Create a PO file from the theme’s POT with Poedit or WP-CLI, compile it to MO, and upload it to wp-content/languages/themes/ as my-theme-es_ES.mo. Then set the site language in Settings β General.
Does Polylang translate WordPress themes?
Partly. Polylang translates content and registered dynamic strings, but gettext strings inside theme files still come from MO files. Use Loco Translate alongside Polylang to create them for each language.
What is the difference between PO and MO files?
A PO file is a human-readable text file with source and translated strings that you edit. An MO file is the compiled binary version WordPress reads at runtime. WordPress 6.5+ can also use faster .l10n.php files.
Can I use Loco Translate with WPML?
Yes. Many developers translate theme strings in Loco and let WPML handle content. Just make sure WPML’s String Translation doesn’t contain conflicting translations for the same strings, or set WPML to prefer MO files.
Is Polylang free for multilingual websites?
Yes. The free version supports unlimited languages, translated posts, pages, menus, widgets, a language switcher and hreflang. Pro (β¬99/year) adds slug translation, DeepL and support; WooCommerce needs a paid add-on.
Which plugin is best for translating WooCommerce themes?
For theme and plugin labels only, Loco Translate. For a fully multilingual shop with translated products and multiple currencies, WPML’s Multilingual CMS plan offers the most complete WooCommerce support in one licence.
Do I need WPML to translate a WordPress theme?
No. For a single-language site, Loco Translate or Poedit is enough. You only need WPML (or Polylang) when visitors must switch between multiple languages.
How do I change the WordPress site language?
Go to Settings β General β Site Language, choose the language and save. WordPress downloads core translations and any available theme/plugin language packs from translate.wordpress.org.
Does TranslatePress compete with these three?
Yes. TranslatePress is a visual front-end translation plugin, a popular alternative to WPML and Polylang for people who prefer translating on a live preview. Like them, it still benefits from proper MO files for theme strings.
16. Final Verdict: Loco Translate vs. WPML vs. Polylang
There’s no single winner, because each tool owns a different layer:
- Choose Loco Translate if your site runs in one language and you simply need to translate WordPress themes and plugins. It’s free, light and safe.
- Choose Polylang + Loco Translate if you want a multilingual website on a budget with excellent performance.
- Choose WPML if you run a multilingual WooCommerce store, manage client sites, or need AI translation and team workflows in one paid package.
Whatever you choose, it starts with a solid, translation-ready theme. Pick one that follows WordPress i18n standards, keep your language files outside the theme folder, and measure the speed impact of any multilingual plugin you add. Do that, and your site can welcome visitors in every language without slowing down.

