Skip Navigation

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

Problem:
The client is unable to return to the English version of their website using the language switcher, as both flags in the header and footer direct to German.
Solution:
We commented out the following lines in the

wp-config.php

file to address the issue:

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

We recommend clearing the site's cache to ensure the changes take effect and the language switcher functions correctly.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, please visit our known issues page and confirm that you have installed the latest versions of themes and plugins. We highly recommend opening a new support ticket for further assistance.

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 2 replies, has 0 voices.

Last updated by gabrielM-43 5 days, 2 hours ago.

Assisted by: Osama Mersal.

Author Posts
January 28, 2025 at 4:21 pm #16643240

gabrielM-43

Background of the issue:
I am trying to set up a language switcher for my website with English as the primary language and German as the secondary language. The issue can be seen on this page: hidden link

Symptoms:
On most pages, I cannot return to English using the language switcher because both flags point to German. This issue occurs in both the header and footer switchers.

Questions:

January 29, 2025 at 9:08 am #16645106

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

Could you please check if the issue persists in a minimal environment by following these steps?

1- Deactivate all the plugins except WPML CMS.
2- Switch to a WordPress default theme like Twenty Twenty-one.

If the issue is gone, activate them one by one to see which one is causing an interaction issue.

❌ Please backup your database before performing the above test ❌

Best regards,
Osama

January 30, 2025 at 10:22 am #16650451

gabrielM-43

I did that. No succes.

But look what we have discovered. While navigating between languages, on different pages, we have noticed that the language switch does not happen because of the domain termination (.de), because the rest of the link is correct. Also check printscreen

hidden link
hidden link

Any solutions?

tes3.jpg
January 30, 2025 at 10:25 am #16650480

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for your update. I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP)
Preferably to a test site where the problem has been replicated.

Your answer will be private, meaning only you and I can access it.

❌ Please backup your database and website ❌

✙ I need your permission to deactivate and reactivate the plugins and themes and change site configurations. This is also why the backup is critical.

✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.

Best regards,
Osama

January 30, 2025 at 11:14 am #16650884

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for the access details. I commented the following lines in the wp-config.php file:

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

Please clear the site's cache and check if the language switcher works correctly.

Best regards,
Osama

January 30, 2025 at 11:29 am #16650998

gabrielM-43

Thank you so much for your help!