Skip Navigation

So, you want to have a WPML site with the different domain per language option?
There are some nice advantages of using different domains on your site that go well beyond appearances.

Some people prefer to access a domain name that looks to belong to their own country and this can create a loyalty in your visitors. There is a kind of SEO bonus as well because you can use the domains to better target your users.

Different domains per language are setup on the WPML -> Languages page.
Different domains per language are setup on the WPML -> Languages page.


First, let’s explain what this exactly means when used in practice.

If for example, you want to have English and German languages with WPML and different domain per language option.

You have two options when setting up per-domain languages:

  • Different domains

If, for example, you have two domains – for your English language, and for your German language, by using that option you can achieve that. > English > German

  • Sub-domains

You can also use sub-domains, like for example for your English language and for your German language. > English > German

So, the next big question is how you can achieve that. The answer depends on two main components of your site’s setup:

  • Your DNS server
  • Your HTTP server (Apache, Nginx, etc.)

Setting up your DNS server

Manual setup

DNS settings with top level domains setup

If you have different top level domains (,, you first need to configure them to have the proper authoritative DNS servers. This is usually done in the settings panel provided by the company that you bought your domain from.

When you have added the domain, you need to create a record in your DNS server, that points to your HTTP server. Simply put, server needs to know what data to provide your users with, once they are on a specific domain. If they reach the .de domain, you want server to show them the German version of your site.

If you have your own DNS server, you can (and it is best to) create an “A Record” for your other domain that points to your server.

There are two different records that you can use.

  • A record – you specify the IP of your server – this is a good and fast solution
  • CNAME record – you specify domain name for your server – a little bit slow, but good if you change the server IP addresses often
List of records. Your screens for configuring top level domains may differ.
List of records. Your screens for configuring top level domains may differ.

DNS settings with sub-domains setup

The setup for sub-domains is easy! You just create an additional A or CNAME record in your DNS server and point it to the same HTTP / HTTPS server IP or domain.

Your screens for configuring subdomains may differ
Your screens for configuring subdomains may differ

Please note that after you complete this settings, you need to continue with the “Setting up your HTTP server” part of this guide.

cPanel setup

Using Cpanel automatically adds the necessary DNS and HTTP entries, so you need to do only this in order to prepare your server.
Setting up top level domain
In most cases the part of your cpanel that you need to use, looks like this.


You can use two kind of methods to add your additional domain:

  • Parked domain – to park the additional domain name – this is the best option, since it uses the same path for your site in the http settings.

Parked domain screen

  • Addon domain – you must be careful to specify the folder with your current WordPress install

Add-on domain screen

Having done that, you can now go to “Wrapping things up” part of this guide.
All settings for your Apache and DNS will be created and added by Cpanel and everything should work.

Setting up the subdomains

To use a subdomain setup, you need to select the subdomains icon from the Cpanel menu.
When creating a subdomain you have to point it to where your WordPress has been installed before in order to work with “Different domain per language” option in WPML.

Subdomains screen

Having done that, you can now go to “Wrapping things up” part of this guide.
All settings for your Apache and DNS will be created and added by Cpanel and everything should work.

Make sure that all domains point to the same root WordPress folder after double-checking the configuration.

Setting up your HTTP server

Okay, so we come to the second most important part of the setup, when you are using a server that you can manage.

In order for your settings to work, you need to create an entry in your web server that will recognize the domain name (or the sub-domain name) that you have just added and pointed to in your DNS server.

If you are running and administrating your own server, it is pretty easy – you just need to add server alias to your current configuration.

Following is an example used for the Apache server setup.

 DocumentRoot "/var/www/"

That’s all to add – easy, right?
It is similarly easy to setup this up on the Nginx server.

server {
server {

Whichever route you choose, the most important thing to consider is that the alias configuration should all point to the same physical folder where your WordPress is being installed.

Setting up and using SSL for your domains

You can always set up and use SSL for your domains and make your site more secure. Since this topic is out of the scope of this article, we suggest reading more about this on the following page:

Wrapping things up

When you have all this set up you can change the settings on the WPML -> Languages to Different domain per language. When you fill out the information required (the other domain or subdomain), pressing the Save button should validate your domain. It will report if there are any problems with the validation, and then save all the settings that you have made.


If you still have problems with the new setup it is best to enable debugging in WordPress. You can do this by adding the following snippet to your WordPress site’s wp-config.php file.

// Turn debugging on
define('WP_DEBUG', true);

// Tell WordPress to log everything to /wp-content/debug.log
define('WP_DEBUG_LOG', true);

// Turn off the display of error messages on your site
define('WP_DEBUG_DISPLAY', false);

// For good measure, you can also add the follow code, which will hide errors from being displayed on-screen
@ini_set('display_errors', 0);

Then you need to monitor the log file that will be created in /wp-content/debug.log when you save the domain options in WPML.

You can also monitor the admin-ajax.php response in your browser console (press F12 on your keyboard to show the console). Based on the console output and the log from ../wp-content/debug.log – you can disable non vital WordPress plugins to try and find the source of the problem.

Browser console example

Session expires while switching languages

When using this Multiple Domain per language option, you may find yourself being asked to log in everytime you switch languages. It happens because the admin session is not carried to secondary languages.

For login/logout across multiple domains, WPML uses a technique that may be blocked by some servers if they call a X-Frame_Options header like:

add_header X-Frame-Options SAMEORIGIN;

If this feature is enabled in your server, WPML will never be able to login/logout across multiple domains. In this case, please contact your hosting provider and deactivate this feature.

If you still have issues it is best to contact one of our specialists here in the WPML forums.


George Botsev
George Botsev

I am a geeky guy, that likes Star Trek, computers, and all other geeky stuff. My other interests are mainly related to IT, System Administration, Electronics, Open Source Software, Open Source Hardware, Photography, and Music.

I have more than 10 years experience with WordPress, and also about 10 years professional experience with IT and System Administration.

My main duty has always been to debug issues, and since September 2014, I joined the WPML Support team and I help some of you in the forums to resolve your problems.

3 Responses to “How to use WPML with different domains per language”

  1. Hi George,

    Thanks for putting this together. I am attempting to configure sub-domains for each language, and am having difficulty. In the setting up your HTTP server section you mention “t is pretty easy – you just need to add server alias to your current configuration.”

    Is this a file? How do we update this? My client is using Plesk, which can use both Apache and Nginx. I am not a developer/programmer, so more clear guidance would be appreciated.