URL & Routing
The URL & Routing settings tab controls how PerfLocale detects a visitor’s language, constructs URLs for translated content, and behaves when a translation is missing. Get this right and everything else in the plugin becomes easy - get it wrong and you end up with duplicate content, unexpected 404s, or SEO issues.
URL structure
Three URL modes, pick one at Settings → URL & Routing → URL Structure:
- Subdirectory (default, recommended):
example.com/de/. Single domain, zero DNS changes, full SEO value concentrates on one hostname. - Subdomain:
de.example.com. Requires DNS + SSL for each language subdomain; useful when language sites are managed by different teams. - Domain per language:
example.de. Highest SEO weight per market (country-code TLDs); requires configuring each domain in WP multisite.
Hide default-language prefix
When on, the default language has no prefix (example.com/about/) and only non-default languages get one (example.com/de/about/). This is the normal look for most multilingual sites - visitors in the default language see clean URLs, translations get their prefix. Turn off to force prefixes on every language (example.com/en/about/).
Language detection order
When a visitor arrives at the root URL, PerfLocale picks a language in this order (first match wins):
- Language cookie from a previous visit (name configurable; see Cookie Lifetime below).
- GeoIP - if GeoIP Redirect is enabled, look up the visitor’s country and pick the matching language.
- Browser
Accept-Language- parse the visitor’s browser language preferences, find the best match among active languages. - Default language - fall back when nothing else matches.
Each layer can be individually disabled. Turning them all off = no auto-redirect; visitors always land on the default language until they click the switcher.
GeoIP Redirect
Uses a GeoIP API (ipapi.co, IPinfo, ipstack, ip-api) to detect the visitor’s country. Results are cached per-IP for 24 hours so repeat visitors don’t trigger a lookup every page load. See GeoIP Redirect for provider comparison + API-key setup.
Excluded Paths
URL paths that should bypass language routing entirely - useful for webhooks, XML feeds, custom REST endpoints, or anything that doesn’t have a "language" in a meaningful sense. One path per line; glob wildcards (*) supported. The default list covers typical WP paths like /xmlrpc.php and /wp-*.php.
Missing Translation Action
When a visitor requests a page that doesn’t exist in their language, what should happen? Three modes:
- Show content in default language - serve the source post under the requested URL. Fastest for the visitor; SEO-wise, PerfLocale wraps the content with
data-nosnippetso Google doesn’t show the default-language snippet under the foreign URL. - Show 404 error - strictest option. No translation, no result.
- Redirect to default language version - send the visitor to the default-language URL (302). The canonical option when you want a single canonical URL per piece of content.
Language Fallbacks
If the requested language doesn’t have the post, should PerfLocale try another language before applying the Missing Translation Action? Per-language ordered list, covered in detail at Language Fallbacks.
Cookie Lifetime
How long the language cookie persists (days). Default 365. Dropping to 30 or 7 is fine for sites with transient visitors; stretching beyond 365 provides no benefit since most browsers cap cookie lifetime to 1 year anyway.
Related
- Language Fallbacks
- GeoIP Redirect
- Hooks Reference - override any of the above via filters.