Skip Navigation

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

Problem:
The client was experiencing an issue where clicking the Slovak flag on their website redirected to an incorrect URL instead of switching back to the Slovak version of the site.
Solution:
We recommended the following steps to diagnose and potentially resolve the issue:
1. Clear Cache: We advised clearing WPML’s internal cache from WPML > Support > Troubleshooting > Clear the cache in WPML, disabling the Language Switcher Cache, clearing any site caching plugins, and the CDN cache if applicable.
2. Use Footer Language Switcher: We suggested activating a footer language switcher from WPML > Languages to check if the issue persists with a different switcher setup.
3. Test in Minimal Environment: We recommended deactivating all plugins except WPML CMS and switching temporarily to a default WordPress theme like Twenty Twenty-one to see if the issue still occurs. This helps in identifying any conflicts with other plugins or themes.

Ultimately, the client discovered that the issue was caused by incorrect custom codes provided by their hosting service for redirecting www/non-www URLs in the wp-config file. Removing these codes resolved the problem.

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.

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 Lukas Bachleda 6 days, 11 hours ago.

Assisted by: Ilyes.

Author Posts
November 19, 2024 at 5:48 am #16417608

Lukas Bachleda

Background of the issue:
I am trying to set up language switching on my website hidden link. When I click the Czech language flag, it correctly redirects to hidden link with the language set to Czech and the currency to česká koruna. However, when I click the Slovak flag to return to the default Slovak language with euros, the link is incorrect.

Symptoms:
The Slovak flag redirects to hidden link instead of the expected hidden link.

Questions:
Why is the Slovak flag redirecting to the wrong URL?
How can I fix the language switcher to correctly link to the Slovak version?

November 19, 2024 at 4:19 pm #16420766

Ilyes
Supporter

Languages: English (English ) French (Français )

Timezone: Pacific/Easter (GMT-05:00)

Hello,

Thank you for contacting WPML support team,

There are a couple of things to try and check to better understand the issue.

1. Clear Cache
If caching is enabled (browser, WPML, or server-level cache), clear it:
Clear WPML’s internal cache from WPML > Support > Troubleshooting > Clear the cache in WPML. and then click on Disable Language Switcher Cache
Clear any caching plugins on your site.
Clear your CDN cache if you’re using one.

2. Use Footer Language Switcher

Go to WPML > Languages > footer language switchers:
Activate it and check if the issue persists on a different switcher

3. Test in Minimal Environment

Please check if the issue persists in a minimal environment by following these steps.
1- Deactivate all the plugins except WPML CMS.
2- Switch for a moment to a WordPress default theme like Twenty Twenty-one.
If the issue is gone, activate them one by one to see which one there is causing a conflict issue.
Please backup your database before performing the above test.

Best regards,

November 20, 2024 at 8:12 am #16422802

Lukas Bachleda

Hello. All you have written we have tried. There was no change, so it still does not work as expected.
Is there any hotfix (PHP snippet), or something like this, which can fix the issue? The page is live and it doesn't look good...

Or is there something, which stops me from creating own custom HTML switcher with correct URL-s?

November 20, 2024 at 9:44 am #16423508

Lukas Bachleda

Hello, the issue is solved. Problem was on our side. The hosting gave some crappy custom codes to wp-config about redirecting www/nonwww, so it caused the problem.
We have removed the code and everything works fine. Thank you for a time.