Loco Translate does not include a language switcher. Its authors say so in the plugin's FAQ: switching language is not what the plugin is for, and there are no plans to add it. Loco Translate edits translation files. Choosing which language a visitor sees is a separate job, and WordPress itself does not do it for anonymous visitors.
Why Loco Translate cannot switch languages
WordPress builds each page in one language, the one set under Settings, General, Site Language. When a page loads, WordPress loads the translation files for that language only, including the files you made in Loco Translate. A visitor has no way to ask for another language, because WordPress has no setting for "this visitor wants French".
So a language switcher has to do two things Loco Translate does not:
- 1Remember the visitor's choice
, usually in a link parameter or a cookie.
- 2Tell WordPress which language to use
for that request, before the translation files load.
The Loco Translate FAQ on switching language points developers to WordPress's locale filter for the second part. The three options below each solve both parts in a different way.
| Option | Uses your Loco files | Translates posts | Effort |
|---|---|---|---|
| A locale filter in code | Yes | No | Small snippet |
| Inpage Translate switcher | No, you re-import each language | No | Settings and a shortcode |
| Polylang with Loco Translate | Yes | Yes | Full multilingual setup |
Disclosure: we make Inpage Translate, which is option 2. The other two options do not involve it.
Option 1: Add a switcher with the locale filter
If your only goal is to let visitors switch the theme and plugin texts you translated in Loco Translate, a short snippet is enough. It reads ?lang=fr_FR from a link, remembers it in a cookie, and tells WordPress to use that language on the front end.
// Languages visitors may choose. Each needs its translation files installed.
const MY_SITE_LANGUAGES = array( 'en_US', 'fr_FR', 'de_DE' );
add_filter( 'locale', function ( $locale ) {
if ( is_admin() ) {
return $locale;
}
$requested = $_GET['lang'] ?? $_COOKIE['site_lang'] ?? '';
return in_array( $requested, MY_SITE_LANGUAGES, true ) ? $requested : $locale;
} );
add_action( 'init', function () {
$requested = $_GET['lang'] ?? '';
if ( ! is_admin() && in_array( $requested, MY_SITE_LANGUAGES, true ) ) {
setcookie( 'site_lang', $requested, time() + YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true );
}
} );Then add links such as <a href="?lang=fr_FR">Français</a> to a menu or widget. Only the values listed in the array are accepted, so the parameter cannot be abused.
Three things to know before you use it:
- Install the WordPress core language too. Add each language once under Settings, General, so WordPress downloads its own translation. Otherwise only your theme and plugin texts switch.
- Your cache must vary by the cookie. A page cache that ignores cookies serves the first visitor's language to everyone. A
?lang=link only helps on the first page, because every page after it has a clean address and depends on the cookie. Make the cookie part of the cache key, or let pages skip the cache while it is set; most caching plugins have a setting for cookies that bypass the cache. - Search engines see one language per address. The same URL shows different languages depending on a cookie, so Google indexes only one version. If the other languages need to rank, you need a multilingual plugin with separate URLs.
Option 2: Use a plugin with a built-in switcher
Inpage Translate, our free plugin, translates plugin and theme texts on the page and comes with its own visitor language switcher. You choose the languages to offer, place a shortcode, and visitors get a list of links.
- 1Choose the languages.
Go to Inpage Translate, Settings, the Languages tab, and tick the languages under Visitor language switcher.
- 2Place the shortcode.
Paste
[inpage_translate_switcher]into a page, a widget, a header area or a Shortcode block. The shortcode prints the site language first, then each language you ticked. - 3Link to one language directly
if you prefer. Adding
?it_lang=fr_FRto an address shows that language, and the choice is remembered in a cookie namedinpage_translate_view. The cache rule from option 1 applies to this cookie too.

Right-to-left languages such as Arabic and Hebrew also set the page direction when a visitor picks them. People who are signed in always see the mixed view, where each text shows the language it was last translated into, so editors never lose sight of their work.
How this fits with your Loco files: the switcher shows translations saved in Inpage Translate. Loco Translate's files for other languages are not loaded by it, because WordPress keeps using the site language's files. To bring your existing work across, export each language as a .po file from Loco Translate and import it under Inpage Translate, Import / Export. The importer reads the language and text domain from the file's header when you leave those fields empty. After that, you can keep editing on the page.

The same caching and search-engine notes as Option 1 apply: make the cookie part of your cache key, and expect search engines to index one language per address.
Option 3: Pair Loco Translate with Polylang
If you also need posts, pages and menus in each language, use a multilingual plugin. Polylang is the usual partner for Loco Translate, because the two do different jobs:
- Polylang creates a translated copy of each post and page, gives every language its own URL (such as
/fr/), and includes a language switcher as a widget, block or menu item. - Loco Translate keeps editing the theme and plugin texts. When a visitor opens a French page, Polylang switches WordPress to French, and WordPress loads your French Loco files.
This is the only option of the three where each language gets its own URL and can rank in search results. It is also the most work: every post must be translated, menus built per language, and the setup tested with your theme.
Which option to choose
- Only interface texts, no code: Inpage Translate's switcher.
- Only interface texts, comfortable with PHP, keeping your Loco workflow: the locale filter.
- Content in several languages, with separate URLs for search: Polylang (or WPML, TranslatePress) with Loco Translate for the interface texts.
Language switcher questions
Does Loco Translate have a language switcher?
No. Loco Translate edits translation files only. Its FAQ states that a language switcher is outside the plugin's purpose and is not planned.
Can I translate my site into two languages with Loco Translate alone?
You can create translation files for as many languages as you like, but without a switcher WordPress shows only the site language. Add one of the three options above to let visitors choose.
Why does my switcher show the wrong language to some visitors?
Almost always a cache. The page was cached for the first visitor's language and served to everyone. Make the cookie part of the cache key, or let pages skip the cache while the cookie is set.
Is a cookie-based language switcher bad for SEO?
It does not hurt the language Google indexes, but the other languages are invisible to search because they share one URL. On posts and pages, WordPress's canonical tag points to the address without ?lang= or ?it_lang=, so parameter views are not indexed as separate pages; Inpage Translate adds no canonical tag of its own. If the other languages need to rank, use a multilingual plugin with a URL per language.
Did it work for you? An honest review on WordPress.org helps other people find the plugin.



