Setting up subdomains for each WPML language w. cPanel

In my opinion, WPML documentation is not very user friendly. Reading the official documentation on setting up the Language URL format, didn’t help me much. I wasted a bit of time on it, so perhaps someone could find this guide useful on how to setup different subdomains for each language with the WordPress Multilingual Plugin, and cPanel. It’s actually a really simple thing to do.

First you need to add the actual subdomains. Just login to your sites cPanel and select “subdomains“, the settings are pretty self explanatory. Probably the easiest way is to just enter a wildcard (*) to the subdomain box and enter the html directory relative to $HOME below it, (usually “public_html”).

This way all the subdomains that you set up in WPML will work straight away. And those subdomains that are not set up, will forward to your main domain. Alternatively you could enter each necessary subdomain individually.

After the “WPML Multilingual CMS” plugin is installed, simply navigate to Dashboard -> WPML -> Languages. Choose the “Site Languages” for your website and head on to the “A different domain per language” setting below “Language URL format“.

Add the domains you want to set up for each language and hit “Apply”. If you get an error when saving the settings: “Error: data not saved”, you could try checking your file permissions. The two lines below will recursively setup 755 permission for directories and 644 for files.

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

That’s about it!

2 thoughts on “Setting up subdomains for each WPML language w. cPanel”

  1. Can you explain a bit more how to change permissions. What are the files / folders? I’m only using Godaddy File Manager


Leave a Comment