Language Switcher

Multiple ways to let visitors switch languages, all fully accessible.

Front-end language switcher close-up: 'Acme Bakery' brand next to the open dropdown showing English (US) at the top and English (UK), Deutsch, Français, Español and العربية with country flags below. Click to see the full storefront header.
Visitors find their language at a glance — in their own script

Gutenberg Block

Drop the PerfLocale Switcher block into any page, post, or widget area. Choose from inline, simple list, or dropdown display modes.

Close-up of the Acme Bakery brand with three languages rendered inline next to it — 🇺🇸 English (US) (active, highlighted in blue), 🇩🇪 Deutsch and 🇪🇸 Español. Click to see how it looks alongside the rest of the storefront header.
Inline placement: shortcode, block, or nav-menu hook

Shortcode and Nav Menu

Use the shortcode anywhere shortcodes are supported, or add languages directly to any WordPress navigation menu as automatic menu items.

PerfLocale Languages admin: 'Languages' heading with 'Add New' and 'Documentation' buttons, then six language cards showing flag, name, native name, locale code, and slug — English (US) Default, English (UK), German, French, Spanish, Arabic. Click for the full table including the Edit / Set as Default / Delete actions.
One-click default · LTR/RTL handled per language

Customization Options

Show or hide country flags, display names in native or current language, choose from size presets, and pick horizontal, vertical, or dropdown layouts.

Screen reader announces
“Deutsch, 2 of 4, listbox”

Fully Accessible

Every switcher variant supports keyboard navigation, Escape to close, arrow keys to navigate, and screen readers announce the current and available languages. When View Transitions are enabled, the cross-document animation respects prefers-reduced-motion. See the dedicated Accessibility page for the full WCAG 2.1 AA story, axe-core release gate, ARIA listbox pattern details, and RTL support.

Block Hooks auto-insert FSE themes

<!-- wp:site-title /-->
<!-- wp:perflocale/language-switcher -->   
<!-- /wp:perflocale/language-switcher -->

# Toggle in Settings → Language Switcher:
[x] Auto-insert in FSE headers

# Or redirect to a different anchor:
add_filter( 'perflocale/switcher/auto_insert_anchor',
  fn() => [ 'core/navigation', 'last_child' ]
);

Block Hooks auto-insert (FSE themes)

On block themes, PerfLocale uses the WordPress Block Hooks API to drop the language switcher block right after the site title in your header — no manual placement required. Users running Twenty Twenty-Four, Twenty Twenty-Five, or any FSE theme that includes the Site Title block get a working switcher the moment they activate the plugin.

Per-context defaults: the auto-inserted block uses a compact dropdown display with a 16-pixel flag so it fits inside header bars without dominating them. Themes can retarget the insertion point (e.g. last child of the navigation block) via perflocale/switcher/auto_insert_anchor or override the per-context attrs via perflocale/switcher/auto_insert_attrs. Setting toggle lets operators opt out entirely.

← Back to Features