Skip Navigation

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

Problem:
How to set the WordPress user's language based on a parameter in a database instead of using URL parameters.

Solution:
If you're trying to set up the language for users based on a database parameter rather than through URL parameters, we recommend updating the language code value in the

icl_admin_language

meta_key within the wp_usermeta database table. You can achieve this by writing a custom function tailored to your specific needs. For more information on setting the WordPress administration language, please refer to our documentation: Setting the WordPress Administration Language.

Please note that this solution might not be applicable to your situation if it has changed since this response, or if it does not match your specific case. We highly recommend checking the related 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 do not hesitate to open a new support ticket with us 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 1 reply, has 2 voices.

Last updated by Andrey 1 year ago.

Assisted by: Andrey.

Author Posts
April 5, 2024 at 11:48 pm #15490093

Alejandro

Tell us what you are trying to do?
My users set up their language using user settings instead of a URL parameter.
How can I set language based on a parameter in a database instead of using URL parameters?

Thanks!

April 6, 2024 at 8:58 am #15490367

Andrey
WPML Supporter since 06/2013

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

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

Currently, setting up the user profile language only through the profile settings is possible.

https://wpml.org/documentation/getting-started-guide/language-setup/setting-the-wordpress-administration-language/

However, if the user sets a language in his profile, the language code value in meta_key icl_admin_language is updated in the wp_usermeta database table. You can write a custom function that updates this value based on your needs.

If this is not what you are asking, please elaborate a little more so I can better understand. Sometimes screenshots illustrating what you mean may go a long way to clarify what words fail to transmit so if you like make use of "upload an image" below the comment area.