Skip Navigation

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

Problem:
The client wanted to know how to hide the WPML language switcher on pages where only one language is available, as they did not want a menu item displaying 'English' when no other translation is available. They noted that the option to hide the current language was not available for dropdown style language switchers.
Solution:
We advised the client to navigate to WPML > Languages and access the "Menu Language Switcher" section. There, they should edit the current language switcher and ensure that the "current language" option is unchecked. This setting will prevent the default language from being displayed when no translations are available. However, for dropdown style language switchers, this option cannot be unchecked because a dropdown requires at least one element to function. Therefore, the dropdown will always show the current language by default.

If this solution does not apply to your situation, or if it seems outdated, we recommend opening a new support ticket. We also 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 further assistance is needed, please contact us in the 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 3 replies, has 2 voices.

Last updated by Mihai Apetrei 1 year ago.

Assisted by: Mihai Apetrei.

Author Posts
April 12, 2024 at 2:24 pm #15513229

yakovV-2

Hi - I would like to know if it is possible to entirely hide the WMPL language switcher on pages where there is only one available language (English). I don't need a page to just say English in the menu if there isn't another available translation. I don't see an option for it anywhere in the plugin, and one previous ticket I could find on the subject had a 404 error in a relevant link

Duplicate ticket: https://wpml.org/forums/topic/display-no-flags-when-page-is-not-translated/

Linked solution with 404: https://wpml.org/forums/topic/completely-hide-language-switcher-if-there-is-no-translation/#post-3518651

Please advise, and if this is not currently possible it would be a very good feature to add to a future update.

April 12, 2024 at 2:55 pm #15513309

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

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

Hi there.

Inside WPML > Languages, if you go to the "Menu Language Switcher" section, you can edit the current language switcher and make sure the "current language" option is UNCHECKED.

As you see in the screenshot here:
hidden link

This way, it will only show a language ONLY when there's an existing translation (the default language will not be showed anymore).

I hope that you will find this information helpful. 🙂

Mihai Apetrei

April 12, 2024 at 3:01 pm #15513340

yakovV-2

Yes, I see that this option is only available for list, and not for dropdown (it is grayed out when the language switcher is styled as a dropdown). It seemed that was also the case for the other referenced ticket. I think it would be a useful feature for the dropdown type as well, but maybe I can use a list for now. Thanks

April 12, 2024 at 3:14 pm #15513364

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

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

Yes, it is true, you can't UNcheck that for the dropdown because it would be impossible for the dropdown to exist if there would be no language option showing up. In order for a dropdown to work like a dropdown, it needs to have at least one element showing inside it. If it has nothing to show in a dropdown format, it can't work.

That is why the option is checked by default for the dropdown format.