Skip to content Skip to sidebar

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 1 year, 1 month ago.

Assisted by: Andrey.

Author Posts
April 2, 2025 at 2:04 pm #16887491

Andrey
WPML Supporter since 06/2013

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

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

I was lucky to fix this for you 🙂 See this comment: https://wpml.org/forums/topic/using-2-domains-for-2-separate-languages/#post-16887482

April 2, 2025 at 2:16 pm #16887549

arturM-15

Yes I see it, thanks... But I added it to fix the issue... Another thing - I assigned separate IP for the website few hours ago, so right now I'm not sure about what solved the issue. Anyway. Thanks for the help. I will mark this as solved.

April 2, 2025 at 2:31 pm #16887580

Andrey
WPML Supporter since 06/2013

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

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

I appreciate your feedback. I want to mention that if you uncomment the lines, the issue reappears, so you know if you need to test something else.