Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are using WPML to manage translations for your website with separate domains for different languages. The language switcher works on the .pl domain but not on the .com domain. Additionally, saving settings in WPML->Languages results in a red void/invalid message on the .com domain.
Solution:
First, ensure that all your domains (or subdomains) point to the same WordPress site where WPML is installed. For more information, please visit this documentation.
Next, deactivate the "Validate on save" option, enter your second domain, save your changes, and then test the domain to see if it works. The validation message might be a false positive. After translating the page, check if you can access it using your secondary domain. If it doesn't work, your second domain might not be configured correctly.
Additionally, check your config.php file for these lines:

define( 'WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] );
define( 'WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] );

Commenting out these lines can resolve the issue with the language switcher.

If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If issues persist, please open a new support ticket at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 6 replies, has 0 voices.

Last updated by Andrey 5 days, 13 hours ago.

Assisted by: Andrey.

Author Posts
March 26, 2025 at 4:59 pm #16864483

arturM-15

Background of the issue:
I am using WPML to manage translations for my website hidden link. I have two domains for two separate languages: Polish on the .pl domain and English on the .com domain. The .com domain is parked on the same account.

Symptoms:
I have the translation for the English language on the .com domain. The switch works on the .pl domain but not on the .com domain. Additionally, saving settings in WPML->Languages gives me a red void/invalid message on the .com domain.

Questions:
Is there any other documentation to follow for setting up WPML with multiple domains? where is the problem

March 26, 2025 at 9:18 pm #16865654

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for contacting WPML support.

You need to ensure that all your domains (or subdomains) point to the same WordPress site where WPML is installed.

For more information, please visit the following link: https://wpml.org/documentation/getting-started-guide/language-setup/language-url-options/how-to-use-wpml-with-different-domains-per-language/

I recommend deactivating the "Validate on save" option, entering your second domain, saving your changes, and then testing the domain to see if it works. Sometimes, the validation message can be a false positive. After translating the page, check if you can access it using your secondary domain. If it doesn't work, your second domain is not configured correctly.

March 27, 2025 at 12:09 pm #16868359

arturM-15

Hi Andrey,

Thank you for your reply.

I have double-checked all the domain parameters and DNS settings – both domains are correctly pointing to the same WordPress installation. The main domain (.pl) works as expected, including language switching. However, the secondary domain (.com) not working properly even after disabling the “Validate on save” option as you suggested.

The .com domain loads the translated content properly, but the language switch point both langs to .com domain - this is the only problem.

Could you please take another look or guide me further on what else might be causing this issue? I would appreciate any additional insight or steps I could try. This is not my first rodeo with WPML and I know, how many I don't know 🙂

Best regards, Artur

March 27, 2025 at 12:30 pm #16868444

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Hello Artur,

Thank you for your feedback.

The .com domain loads the translated content properly, but the language switch point both langs to .com domain - this is the only problem.

That is interesting 🙂

Does the same issue persist if you temporarily disable all plugins except WPML, if possible?

Please also add the language switcher temporarily to the menu or somewhere else to check the results.

March 27, 2025 at 1:24 pm #16868711

arturM-15

switch in below the footer. Without required plugins situation is the same.

March 27, 2025 at 1:26 pm #16868716

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Yes, I have already tested this. Have you tried adding it to the menu and testing?

I need to request temporary access (wp-admin and FTP) to your site—preferably to a test site where the problem has been replicated if possible—in order to be of better help. When you log in to leave your next reply, you will find the needed fields below the comment area. The information you will enter is private, meaning only you and I can see and access it.

March 27, 2025 at 2:18 pm #16868920

arturM-15

Should be not visible, but i could see details in private mode. Deleted!

March 27, 2025 at 2:24 pm #16868953

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Let me activate the private field again. The following reply should be private.

March 27, 2025 at 3:37 pm #16869450

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for the information.

I have reviewed the WPML settings and options, and everything appears to be configured correctly in your dashboard. There is no issue if I temporarily switch to another URL format, "Different languages in directories", in WPML → Languages → Language URL format.

However, this leads me to think that the domain configuration may be the issue. I'm not familiar with your server settings or how your hosting operates. Generally, to set up a secondary domain locally, you would point the secondary domain to the local server and configure it as an alias in the server settings.

Would you mind checking if there is an alternative way to configure your secondary domain according to the article above?

March 28, 2025 at 8:03 am #16871360

arturM-15

I changed domain from parked domain to addon domain, but that changes nothing. Domain config you can check with any DNS tool and both domains point to the same place. Everything works fine except one switch. For some reason can't save domain, and this plugin don't say what is wrong. Can you suggest some debug way to get info, what is wrong with domain, why this save function returns error?

March 28, 2025 at 12:42 pm #16872918

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback.

There is no specific debugging tool that indicates what is wrong with the domain settings. However, you can try activating the debugging feature in WordPress to see if any related errors appear.

To enable it, open your wp-config.php file and look for define('WP_DEBUG', false);. Change it to:

define('WP_DEBUG', true);

To enable the error logging to a file on the server, you need to add yet one more similar line:

define( 'WP_DEBUG_LOG', true );

The errors will be saved to a debug.log file inside the /wp-content/directory.

https://wpml.org/documentation/support/debugging-wpml/

Let me know what you see in the debug.log after enabling debug mode.

Can I create a copy of your site to test if the domains work on a local server? I'll need to install a "Duplicator" temporarily or "All In One Migration" plugin on your site. This will allow me to create a copy of your site and your content.

April 2, 2025 at 1:24 pm #16887293

arturM-15

No, the problem is not solved. I have manual half-solution and no idea what is your plugin complaining about. Need solution, need support.

April 2, 2025 at 1:56 pm #16887449

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

I have conducted some tests locally in a fresh environment using the "A different domain per language" option, and I could not replicate the problem.

I can test your site in my local environment to see if I can replicate the issue using your site. This will help us understand if the problem lies with the domains or with the specific installation. However, I am not clear if I am allowed to make a copy of your site for this purpose.

April 2, 2025 at 1:59 pm #16887482

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

I have examined this further and discovered the following definitions in your config.php file:

define( 'WP_HOME', '<em><u>hidden link</u></em>' . $_SERVER['HTTP_HOST'] );
define( 'WP_SITEURL', '<em><u>hidden link</u></em>' . $_SERVER['HTTP_HOST'] );

Commenting out these lines resolves the issue with the language switcher.

April 2, 2025 at 1:59 pm #16887483

arturM-15

yes, please. It's not e-commerce website, no secrets there... yet:). If you need some info, please ask. Access data still the same.