Skip Navigation

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

Problem:
Customer has a problem with the recently enabled "Automatic Redirection Based on Browser Language" functionality. Your site is configured to work with different directories in the URL format option (/en/, /it/, etc.). If a customer opens the site from an external link with a custom language (for example, /zh_hans/ sent by mail), on first opening the browser language is selected using the browser redirect function (for example, /en/ ). If the customer closes the page without browsing or interacting with the site and clicks the emailed link again, the site displays correctly in the language requested in the URL (/zh_hans/). The client asks if there is a way to ignore the browser redirect if the language is in the URL and use the browser redirect only if the URL does not specify the requested language.
Solution:
We explain that the current behavior is as expected and provide a link to the documentation for clarity:
https://wpml.org/documentation/getting-started-guide/language-setup/automatic-redirect-based-on-browser-language/ . We also suggest that any customization to change this behavior would require custom work, which is outside the scope of our support. We recommend hiring a WPML developer or contractor to implement the desired functionality:
https://wpml.org/contractors.

This solution may no longer be relevant due to updates or because it does not apply to your specific case. If this is the case, we recommend opening a new support ticket. Additionally, we strongly suggest that you check out the related known issues at https://wpml.org/known-issues/ , check the version of the permanent solution and confirm that you have installed the latest versions of themes and plugins. If you need additional assistance, feel free to contact us on the WPML support forum: https://wpml.org /forums/forum/spanish-support/.

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 1 reply, has 2 voices.

Last updated by Mihai Apetrei 1 year, 3 months ago.

Assisted by: Mihai Apetrei.

Author Posts
February 9, 2024 at 10:40 am #15285142

Matteo

Hi,

we have an issue with the recently activated "Automatic Redirect Based on Browser Language" functionality.
Our site is configured to work with different directory the the URL format option (/en/, /it/, etc.....).

At the moment if the site is opened from an external link with a custom language (for example sent the link with /zh_hans/ via mail to a client), on the first opening the browser language is selected via the browser redirection function (for exmaple /en/).

If the client, withouth navigate or interacting with the site in any way, close the page and re-click the link sent via email the site is displayed correctly with the requested language in the URL (so correctly in /zh_hans/).

I don't understand if it's a bug or a wanted behaviour but, i was wandering if there is a way in order to ignore the browser redirection if the language is in the URL, and use the browser redirect only if the URL doesn't specify the requested language.

Thank's.

February 9, 2024 at 10:55 am #15285199

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

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

Hi there.

That is the way it is supposed to work (attaching a screenshot from the documentation at the URL below):
https://wpml.org/documentation/getting-started-guide/language-setup/automatic-redirect-based-on-browser-language/

Customizing things in the way that you mentioned will require custom work and that falls out of the scope of our Support so I recommend that you hire a developer or a WPML contractor (https://wpml.org/contractors) to implement the functionality if you need things to work that exact way.

I hope that you will find this information helpful. 🙂

Mihai Apetrei

Screenshot 2024-02-09 at 12.52.30.png
February 9, 2024 at 11:18 am #15285419

Matteo

Hi Mihai,

we will consider whether to disable the redirect or proceed with customization.
For the time being thanks for the clarification.

Have a nice day! Bye!