Using Loco Translate is a fantastic way to translate your WordPress themes and plugins directly from the dashboard. But sometimes it can get frustrating. You’ve translated every string and see them clearly in the editor. Yet, when you check your site, it’s still in English. What gives?
Let’s break down exactly why this happens and how to fix it, in a simple and fun way!
TL;DR
If your translations show in Loco Translate but not on your site, it’s usually a sneaky mix of caching issues, wrong textdomain use, or incorrect file loading order. Clear your caches, make sure textdomains match properly, and confirm the translation files are loaded early enough. These steps have saved many hair-pulling nights!
1. Let’s Talk Translation Basics
When you use Loco Translate, it edits or creates .po and .mo files. These files store the translated strings and help WordPress display them on the site. But for this to work:
- The translated files must be loaded.
- The exact string must be translatable.
- The correct textdomain must be used.
If even one thing is off, WordPress may ignore your translations and show the default English text instead.
2. First Suspect: Caching
Caching is usually the culprit. WordPress sites can be speed demons thanks to caching — until you make changes and they don’t show up.
Try the following:
- Clear your browser cache.
- Use the “Clear Cache” button in your caching plugin (if you use one).
- Deactivate caching plugins temporarily and reload the site.
- If your host includes server-side caching (like WP Engine or SiteGround), clear that too.
After doing that, reload your site. Still English?
3. Textdomain Trouble
The textdomain is a tag your theme or plugin uses to tell WordPress which translation file to use. For example:
__('Hello World', 'my-plugin')
That ‘my-plugin’ part must match the one registered in your plugin or theme and in your translation files.
If the theme author forgets to use the correct domain or makes a typo, Loco Translate might show the strings, but WordPress won’t load them on the front end. Boo!
How to Check Textdomain Issues
Open the source file or template in your theme/plugin. Look for translation functions like:
__()_e()esc_html__()esc_html_e()
See if they use the same textdomain as your Loco Translate file. If they don’t match — bingo! That’s likely your issue.
Also, make sure the domain is declared correctly. In plugins, it may be in the header like so:
Text Domain: my-plugin
And don’t forget that in themes, load_theme_textdomain() needs to be called in functions.php.
4. The Load Order Shuffle
If the translation file isn’t loaded in time, the plugin or theme doesn’t know you want to use those translations. Imagine making pancakes before you heat the pan — it’s just not going to work.
To fix this:
- Ensure that
load_plugin_textdomain()is inside theplugins_loadedaction. - For themes, load translations using
load_theme_textdomain()duringafter_setup_theme.
Example for a plugin:
function my_plugin_load_textdomain() {
load_plugin_textdomain( 'my-plugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
add_action( 'plugins_loaded', 'my_plugin_load_textdomain' );
This ensures your .mo file is available when WordPress needs to show translated content.
5. A Fun Cache Cleanup Routine
If you don’t know where to start, here’s a fast track routine:
- Clear your browser cache.
- Clear all plugin and server caches.
- Temporarily deactivate caching plugins.
- Reload your translated page while logged in as admin.
If your strings magically appear in the translated language, it was a cache thing! Want to shout for joy? We feel you.
6. Loco Translate Best Practices
Where you save your translations matters.
- Prefer “Custom” location when saving translation files using Loco Translate.
- Why? Because updates to themes or plugins won’t overwrite your files in the “Custom” folder.
- The file path typically looks like:
wp-content/languages/plugins/my-plugin-en_US.po
7. Expose Hidden Strings
Sometimes, the strings just don’t appear in Loco Translate to begin with.
Causes:
- Strings built via
sprintf()or variables — WordPress can’t parse those easily. - Hardcoded HTML with mixed markup.
Check the source code. Rewriting such strings using fully translatable functions can fix this. For example:
echo sprintf( __('Welcome, %s!', 'my-plugin'), $username ); // GOOD
echo 'Welcome, ' . $username; // BAD
Only the first one is translatable.
8. When All Else Fails: Debug It
Still not working? Get sneaky with debugging!
- Use
gettextfilters in your theme to check what strings are passed for translation. - Install the Query Monitor plugin to hook into translation loading actions.
You can even add this filter to tweak translations manually:
add_filter( 'gettext', 'custom_override_translation', 10, 3 );
function custom_override_translation( $translated_text, $text, $domain ) {
if ( $text === 'Hello World' && $domain === 'my-plugin' ) {
return 'Bonjour le monde';
}
return $translated_text;
}
This is like directly teaching WordPress how to say it properly. Fun, right?
9. Wrapping It Up (Finally 🎉)
Translations can be tricky. Everything looks right in Loco Translate, but your site stubbornly sticks to English. The answer is almost always among these:
- A too-persistent cache
- A mismatched textdomain
- Translation files not loaded early enough
With a little detective work and a bit of patience, you can fix it. And once you do — ahhh, that sweet satisfaction when you reload your site and finally see the new language!
Pro Tip: Keep backups of your .po and .mo files, especially when updating plugins or themes. That way, your hard work translating doesn’t vanish overnight.
Happy translating! 🌍✨