Multilingual Sites (i18n): Locale Routing, hreflang & Switchers
Daypress ships native Polylang and WPML parity under Settings → Languages (/d-admin/languages)—routing localized URLs, emitting hreflang alternates, and switching visitor locales without third-party plugins.
1. Configure site languages & URL prefix strategy
Open Settings → Languages (/d-admin/languages) to register your active locales (including built-in presets for German, Dutch, French, Spanish, Italian, Japanese, Arabic/Hebrew with automatic dir="rtl" support, or any custom ISO code):
- Unprefixed Default Locale (Recommended): Serves your primary language cleanly at root (
/pricing/) and secondary locales under their ISO prefix (/nl/prijzen/,/de/preise/,/es/precios/). - Prefix All Locales: Routes every language—including the default locale—under its ISO prefix (
/en/pricing/,/nl/prijzen/).

2. Create translations & link hreflang groups
Each localized page is a full first-class post or page in SQLite with its own translated slug, SEO metadata, and DayStudio layout AST:
- Clone the source page: Click Duplicate on
/d-admin/edit?post_type=page(or calldaypress_duplicate_post) so the localized page inherits the exact visual structure. - Translate & publish: Update the title, localized slug (e.g.
over-ons), prose, and SEO description. - Link into a Translation Group: Connect the pages in the Link Existing Translations panel on
/d-admin/languages, inside the editor's Translations meta box, or viadaypress_link_translations:
// MCP: daypress_link_translations
// Links English (#12), Dutch (#48), and German (#49) into one bidirectional hreflang group
{
"translations": {
"en": 12,
"nl": 48,
"de": 49
}
}Once linked, Daypress automatically injects reciprocal <link rel="alternate" hreflang="..."> tags (plus x-default) in every page's SSR <head> and outputs <xhtml:link rel="alternate"> entries in /sitemap.xml.
3. Place the LanguageSwitcher widget
When a visitor clicks a language in the switcher on /pricing/, Daypress routes directly to its linked counterpart (/nl/prijzen/), falling back gracefully to that locale's homepage (/nl/) if an individual post isn't translated yet:
// DayStudio AST node inside your Header template:
{
"id": "header_lang_switcher",
"type": "LanguageSwitcher",
"data": {
"display_style": "pills", // "pills" | "dropdown" | "inline"
"show_flags": false,
"show_names": false // false = compact ISO codes (EN | NL | DE)
},
"styles": {}
}
// Or embed anywhere via shortcode: