Skip Navigation

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

Problem:
When using the WPML language switcher on a website, pressing the switcher redirects back to the default language instead of maintaining the selected language.
Solution:
1. Check and revise the DNS entries. Consider disabling services like Cloudflare/Cloudfront and Kinsta caching to see if this resolves the issue. You may need to contact your hosting support for assistance.
2. Ensure that the server configuration is correctly set up for sites in a subfolder. This involves checking the rewrite rules in either the

.htaccess

file or the

nginx.conf

file.
If these steps do not resolve the issue, we may need to create a duplicator package of your site to further diagnose the problem. For more details on how to provide a duplicator package, please visit https://wpml.org/faq/provide-supporters-copy-site/.

Please note that this solution might be outdated or not applicable to your specific case. 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 the issue persists, 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.

Tagged: 

This topic contains 21 replies, has 2 voices.

Last updated by Noman 1 year ago.

Assisted by: Noman.

Author Posts
May 20, 2024 at 2:37 pm

毅 青木

Background of the issue:
I am working on translating an article for testing purposes using WPML on my website hidden link. The specific article I am translating can be found at hidden link.

Symptoms:
When I press the language switcher on the page, it redirects me back to the default language, which is Japanese, instead of maintaining the selected language.

Questions:
Why does pressing the language switcher redirect me to the default language instead of staying on the selected language?
Is there a specific setting or configuration in WPML that I need to adjust to fix this issue?

May 20, 2024 at 5:39 pm
May 20, 2024 at 5:44 pm #15647020

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I’ve removed the sub-directory “/media” in secondary language URL input fields from WPML >> Languages > Language URL format as you can see in the attached screenshot and re-saved the permalinks from the Settings >> Permalinks page and now it seems to be working correctly. Could you please check and confirm?

Thank you for your cooperation

removed media from URL.png
May 20, 2024 at 10:28 pm #15647399

毅 青木

Thank you very much! I was able to translate it.

There is one more thing I don't understand.
How do I translate the categories and other untranslated parts of the English and Chinese translations as shown in the attached image?

2024-05-21_07h21_40.png
2024-05-21_07h18_22.png
May 20, 2024 at 10:35 pm #15647430

毅 青木

Sorry.
Different languages in directories ( (hidden link - (Japanese)Japanese, hidden link
japan.jp/media/zh-hans/ - Chinese))

This is how it is set up and cannot be set up in A different domain per language.

Please check.

2024-05-21_07h34_35.png
2024-05-21_07h32_24.png
May 21, 2024 at 11:18 am #15650112

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

1. You should be able to translate the categories/taxonomies from WPML >> Taxonomy Translation page. Here is a doc for more details:
https://wpml.org/documentation/getting-started-guide/translating-post-categories-and-custom-taxonomies/

2. For translating the text that is coming from theme/plugin files/options pages, please go to WPML >> String Translation page, search your required text and add the translation. Here is a doc for more details: https://wpml.org/documentation/getting-started-guide/string-translation/

3. For the original redirection issue, I’ve tried troubleshooting steps but none of them worked so far, I’m going to escalate this issue to our 2nd tier support for further review.

Thank you for your cooperation

May 21, 2024 at 11:55 am #15650254

毅 青木

1,2 Thank you.

3,Please continue to check on this matter.

May 22, 2024 at 1:55 pm #15658728

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I've escalated this issue to our 2nd tier supporter for further review and I will update you once I hear back about it.

Thank you for your cooperation and patience

May 22, 2024 at 10:02 pm #15659877

毅 青木

Thank you very much.
We appreciate your response.
Thank you for your continued support.
If there is any information you need, please let me know.

May 23, 2024 at 6:31 am #15660504

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

We can't access the WP login page; it shows a 404 error (see attached screenshot). Can you please check and fix this issue so our 2nd tier support can investigate further?

Thank you for your cooperation.

404 Not Found error.png
May 23, 2024 at 2:08 pm #15663743

毅 青木

Thank you for your assistance.

I have restored yesterday's backup and it has not improved.
I contacted the Kinsta engineers and it seems to be redirecting.
hidden link
↓↓
hidden link

I have not done any work on my end, did you change any settings?

May 23, 2024 at 4:52 pm #15664661

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I checked for theme/plugin conflicts and enabled error reporting, then reverted the changes, and the site was working correctly. Hosting support may be able to help with this.

Thank you

May 23, 2024 at 9:57 pm #15665312

毅 青木

Best regards!

May 26, 2024 at 12:48 pm #15670959

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your message. Please let us know when the site dashboard is accessible so we can proceed with further investigation.

Thank you for your cooperation

May 26, 2024 at 3:21 pm #15671090

毅 青木

I was able to log in.
It is a SWELL theme, but the child theme seems to have interfered with it, so it is in parent theme status.
Also, the kinsta engineer gave me some information to refer to.
Best regards.

2024-05-27_00h21_01.png