Kntnt Bogo sv_SE / en_GB Language Routing
Route WordPress visitors to Swedish or British English with explicit Bogo language URLs.
by Kntnt · github.com/kntnt/kntnt-bogo-sv_se-en_gb-language-routing · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/kntnt/kntnt-bogo-sv_se-en_gb-language-routing/archive/refs/heads/main.zipKntnt Bogo Swedish / British English Language Routing
Kntnt Bogo Swedish / British English Language Routing provides automatic browser-language routing for bilingual WordPress websites. It gives every language an explicit Bogo URL prefix and redirects visitors arriving at the site root to Swedish when their browser accepts Swedish, or to British English otherwise. This keeps language URLs explicit while offering an automatic language choice without cookies.
Routing behavior
- Uses the fixed locales
sv_SEanden_GB; there is no settings screen. - Chooses Swedish whenever a valid Swedish language entry has a positive quality value, even if another language ranks higher. Missing headers, wildcard-only preferences, and Swedish with
q=0fall back to British English. - Redirects only GET/HEAD landing requests at the site root with HTTP 302.
- Preserves permitted campaign parameters:
utm_*(lowercase letters and underscores after the prefix),gclid,dclid,fbclid, andmsclkid. - Leaves explicit language URLs and requests with other query parameters to their existing handlers.
- Sends private/no-store cache headers and
Vary: Accept-Language, and setsDONOTCACHEPAGEfor qualifying landing requests.
The decision is made again on every root visit; it does not remember a manual language selection.
Setup
Requires Bogo with both sv_SE and en_GB active, suitable home-page content in both languages, and pretty permalinks.
After installing or removing the plugin, save Settings → Permalinks to rebuild language routes. Configure any reverse proxy, CDN, or page cache to bypass the root landing URL: a cache answering before WordPress runs cannot receive the plugin’s headers. With a regular-plugin installation, cache plugins loaded earlier may also require an explicit exclusion.
Installation
Requires WordPress and PHP 7.4 or later, plus the plugin-specific dependencies described above.
As a must-use (MU) plugin
- Download this repository using Code → Download ZIP and extract it.
- Connect to your site using SFTP, SSH, or your hosting file manager.
- Create
wp-content/mu-plugins/if it does not exist. - Copy
kntnt-bogo-sv_SE-en_GB-language-routing.phpdirectly into that directory. WordPress does not automatically load PHP files inside MU-plugin subdirectories. - The plugin loads automatically without activation and appears under Plugins → Must-Use.
As a regular WordPress plugin
If you prefer a regular plugin or do not have access to the MU-plugin directory, you can install this plugin normally:
- Download the repository ZIP using Code → Download ZIP.
- In WordPress, go to Plugins → Add New Plugin → Upload Plugin.
- Select the ZIP, click Install Now, and then Activate Plugin.
You need permission to install plugins. Install only one copy: remove the MU copy before activating a regular copy, or deactivate and remove the regular copy before installing it as MU.
Updates and removal
This repository does not include an automatic updater. To update an MU installation, replace its PHP file. For a regular installation, upload the new ZIP and use WordPress’s replacement option. To remove an MU installation, delete its PHP file; for a regular installation, deactivate and delete it in Plugins. Follow any plugin-specific setup or removal steps above.
License
Copyright (C) 2026 Kntnt.
Licensed under the GNU General Public License, version 2 or (at your option) any later version (GPL-2.0-or-later). See LICENSE for the full GPL v2 text.