---
title: "Language Switcher - PerfLocale"
description: "Gutenberg block, shortcode, nav menu, and admin bar language switcher with full ARIA accessibility and keyboard navigation."
canonical: "https://perflocale.com/features/language-switcher/"
source: "https://perflocale.com/features/language-switcher/"
format: "markdown"
---
# 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.](https://perflocale.com/assets/shots/10-home-en-switcher--zoom.png)

Each language in its own script — visitors recognise their language without reading English. 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.](https://perflocale.com/assets/shots/30-header-menu-en--inline.png)

Same switcher, rendered inline — works in any shortcode-aware block, or as a nav-menu item. 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.](https://perflocale.com/assets/shots/02-languages--list.png)

Add once — flag, native name, slug, locale and direction propagate everywhere automatically. 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.

-   English (US)
-   Deutsch
-   Français
-   العربية

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](https://perflocale.com/features/seo/#view-transitions) are enabled, the cross-document animation respects `prefers-reduced-motion`. See the dedicated [Accessibility page](https://perflocale.com/features/accessibility/) for the full WCAG 2.1 AA story, 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`](https://perflocale.com/docs/hooks/#perflocale-switcher-auto-insert-anchor) or override the per-context attrs via [`perflocale/switcher/auto_insert_attrs`](https://perflocale.com/docs/hooks/#perflocale-switcher-auto-insert-attrs). Setting toggle lets operators opt out entirely.

[← Back to Features](https://perflocale.com/features/)
