Skip Navigation

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

Problem:
The client wants to hide the language switchers on their WPML enabled site except for certain logged-in admin users.
Solution:
We recommend hiding the secondary languages, which will also hide the language switcher. You can do this by navigating to WPML -> Languages -> Hide languages section. For more information, please visit hiding languages on the front-end.

To allow hidden languages to be accessible to specific users, go to Users -> All Users, click 'Edit' next to the user you want to grant access to. In the WPML language settings section, check the Display hidden languages checkbox and then click the Update Profile button to save the changes.

If this solution does not seem relevant to your situation, please feel free to open a new support ticket in our 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.

This topic contains 1 reply, has 2 voices.

Last updated by Mateus Getulio 1 year, 5 months ago.

Assisted by: Mateus Getulio.

Author Posts
December 29, 2023 at 12:00 pm #15136615

paulR-48

Hi. I am nearly ready to move my WPML enabled system including custom code to the live site. Initially I may not have got all translations done so ideally I would like to hide the language switchers except for particular logged in admin users. I cannot find this in help. Is there a standard way of doing it. Alternatively could I perhaps use a hook to disable any attempt to switch language unless I am logged in as admin. Thanks

December 29, 2023 at 9:52 pm #15137627

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Thanks for your contact!

As an alternative, you can hide the second languages, which will also hide the switcher. You can that by going to the WPML -> Languages -> Hide languages section. More info: https://wpml.org/documentation/getting-started-guide/language-setup/hiding-languages-on-the-front-end/

Then, to make the hidden languages still accessible to you or any other user, please go to Users -> All Users, and click 'Edit' next to the desired user. Find the WPML language settings section and click the Display hidden languages checkbox. Then hit the Update Profile button to save.

Please let me know if it helps. Thank you!

Regards,
Mateus.

December 30, 2023 at 10:20 am #15137906

paulR-48

Thank you. Perfect answer