A domain per language in WordPress
By default each language lives in a folder of your site, such as yoursite.com/de/. With WP Provider Translate you can give a language its own domain instead, such as yoursite.de, while everything stays in one WordPress site. You set up the domain so it reaches your site, type it in the settings, and WP Provider Translate moves that language there once it has checked the domain works.
How it works
- One WordPress site, several domains. The extra domain shows the same WordPress site, in its language. You keep editing in one place, on your main domain.
- Per language. You choose for each language: a folder or a domain. Your site’s own language always stays on the main domain.
- Links follow. Every link on a German page, the language switcher, the hreflang tags and the sitemap point to
yoursite.de. - Old folder addresses move. Once the domain is in use,
yoursite.com/de/…redirects permanently (301) to the same page onyoursite.de, so links and search results carry over. - Only after a check. WP Provider Translate uses a domain only once it has confirmed the domain really reaches your site. Until then, the language stays in its folder, so visitors never land on a broken domain.
What your domain needs
Before you enter the domain in WordPress, set it up with your domain registrar and hosting provider. WP Provider Translate needs three things:
- The domain points to this same WordPress site. Not a copy, and not a redirect: the domain must show this site’s files and database. Hosting control panels often call this a domain alias, a parked domain or a domain pointer. The domain’s DNS records point to the server your site runs on.
- The domain has its own SSL certificate, so it opens over
https://without a browser warning. - The domain does not redirect. Opening
https://yoursite.demust show your site onyoursite.deitself, not send the visitor on to your main domain.
Ask your hosting provider for “an alias of my main domain, with SSL” if you are not sure how to do this. DNS changes can take a few hours to reach everyone.
Steps
- Set up the domain as described above, and wait until
https://yoursite.deshows your site. - In WordPress, go to WP Provider Translate → Settings.
- Under Languages → Address per language, find the language and type its domain, such as
yoursite.de. Leave outhttps://and any path. Leave the field empty for languages that stay in a folder. - Click Save Changes. WP Provider Translate checks the domain straight away.
- Look next to the domain:
- Verified: the language now lives on that domain.
- Not reaching this site (…): still served at /de/. The check failed; the reason is shown between the brackets. The language keeps working in its folder. See Troubleshooting below.
Each domain can be used for one language only, and your main domain can’t be a language domain.
With or without www
Enter the domain the way you want visitors and search engines to see it: yoursite.de or www.yoursite.de.
If visitors may type the other form too, set that up as well: the www. form (or the form without it) needs its own DNS record and its own SSL certificate. WP Provider Translate then redirects page visits on that form permanently (301) to the domain from your settings, keeping the rest of the address. Form submissions and background requests are not redirected, so nothing they send is lost.
For your main domain, WordPress itself decides between www. and no www., as it always has.
Login and wp-admin stay on the main domain
You log in and manage your site on your main domain, as before. Opening yoursite.de/wp-admin/ or the login page on a language domain takes you to the same place on the main domain.
Everything visitors need loads from the domain they are on: images, files, fonts, and the requests a shop or form makes in the background. That keeps fonts showing and forms and carts working on every domain.
Cart and login move along with the visitor
Browsers keep cookies per domain, so normally a visitor who switches from yoursite.com to yoursite.de would lose their shopping cart. WP Provider Translate takes it along:
- The cart comes along when a visitor clicks the language switcher, or the language item in your menu, to go to a language domain. This works for WooCommerce carts.
- A logged-in customer stays logged in, when the site runs on HTTPS and the visitor is still on the same network.
- Safe by design. The link itself carries nothing: on the click, the site hands out a one-time code that works only once, only for that visitor’s browser, and only within 60 seconds. Copied or shared links never contain it.
Typing the other domain directly, or opening it in a new tab, starts a fresh visit there without the cart.
Each language in its own WordPress language
A language works the same on its own domain as in a folder: WordPress runs in that language (the lang of the page, dates, and the texts of your theme and plugins from the WordPress language packs). Requests a page makes in the background, such as a cart update or a form check, are answered in the language of the page they came from.
Sitemaps and robots.txt per domain
Search engines only accept addresses on a sitemap’s own domain, so each domain gets its own sitemap:
- Each language domain serves your sitemap at the same address as your main site (for example
yoursite.de/wp-sitemap.xml, oryoursite.de/sitemap_index.xmlwith Yoast SEO or Rank Math). It lists that domain’s pages, each with all its language versions as alternates. - The main domain’s sitemap lists the pages on the main domain: your own language and languages in folders. Pages on language domains appear there only as alternates.
- robots.txt on a language domain names that domain’s own sitemap.
- Opened in a browser, a sitemap on a language domain shows as a readable page, like on your main domain.
In Google Search Console, add each language domain as its own property and submit its sitemap there. See Multilingual SEO for the rest of what search engines get.
Good to know
- The check runs again every day. If a domain stops reaching your site (an expired certificate, a DNS change), the language moves back to its folder by itself until the domain works again.
- Your main domain stays the address of the site. WordPress’s own settings don’t change; switching a language back to a folder is a matter of emptying the field and saving.
- Coming from WPML with a domain per language? Your domains come along with the import. See Switching from WPML.
Troubleshooting
- “Not reaching this site (HTTP 404)” or another HTTP number. The domain reaches a server, but not this WordPress site. Check that the domain points to the same site (an alias), not to an empty folder or a different website. HTTP 301 or 302 means the domain redirects; make it show the site instead.
- “Not reaching this site” with a connection or SSL error. The domain doesn’t resolve yet, or its SSL certificate is missing or doesn’t cover the domain. Wait for DNS to update, make sure the certificate covers exactly the name you entered (with or without
www.), then click Save Changes again to run the check again. - HTTP 401 or 403. Something blocks the check before WordPress answers, such as a firewall or a security plugin that switches off the WordPress REST API for visitors. Allow it for this site.
- The
www.form of a language domain doesn’t open. It needs its own DNS record and must be covered by the SSL certificate; the redirect to your chosen form only works once it reaches the site. - The cart is empty after switching domain. The cart comes along only through a click on the language switcher or menu item on your site. A typed address or a new tab starts a new visit.
For developers
wppt_cross_domain_cookiesadds cookie name prefixes that follow a visitor to another language domain (WooCommerce’s cart cookies are added already).wppt_carry_logindecides per user whether a login moves along; returnfalseto keep logins on one domain.- See Developer filters and actions for their arguments.