Troubleshooting Polylang Language Switcher Dropdown Issues
Content
Many WordPress users rely on the Polylang plugin to create multilingual websites. A common point of confusion and frustration involves configuring the language switcher, particularly when using the dropdown display mode. Users frequently report that certain settings, like "Hide current language," don't behave as expected within a dropdown, or that the switcher doesn't appear at all in certain theme locations.
Why Do These Dropdown Issues Happen?
Based on common community reports, these problems typically stem from a few key areas:
- Theme and Plugin Conflicts: Your theme's structure or another plugin's code can interfere with how Polylang generates and styles its dropdown menu. This is a very frequent cause.
- CSS Specificity: The CSS rules that hide languages or style the dropdown might not be specific enough, or they may only target the desktop version of your site, failing on mobile views.
- Caching: Caching plugins (like LiteSpeed Cache or WP Rocket) can serve a cached version of the page that doesn't reflect the current language or switcher state.
- Builder Compatibility: Page builders (e.g., Breakdance, Divi) and the Full Site Editor (FSE) in themes like Twenty Twenty-Three handle menus differently, which can sometimes break the Polylang integration.
Common Solutions to Try
1. Basic Configuration Check
First, ensure your switcher is configured correctly. When adding the language switcher to a menu, you are presented with several options:
- Displays as dropdown: Check this box to enable the dropdown view.
- Shows flags: Toggle the display of country flags.
- Shows language names: Toggle the display of language names.
- Hides the current language: This setting is intended to prevent the currently active language from appearing in the list. Note that some users report this specific option does not function within a dropdown view, which may be a known limitation of the free version.
Double-check these settings in your WordPress menu editor.
2. Conflict Testing
This is the most critical step for diagnosing the issue.
- Deactivate all your plugins except Polylang.
- Switch to a default WordPress theme like Twenty Twenty-One.
- Check if the language dropdown now works correctly.
- If it does, reactivate your plugins and theme one-by-one, checking the dropdown after each activation, to identify the source of the conflict.
3. Caching Plugin Configuration
If you use a caching plugin, you must configure it to be compatible with multilingual sites. This usually involves excluding cookies or specific pages from the cache. For Polylang, you often need to prevent the caching of the pll_language cookie. Consult your specific caching plugin's documentation for how to set these exceptions.
4. Custom CSS for Specific Hiding
If you need to hide specific languages from the switcher, you might need custom CSS. Be aware that this requires targeting the correct HTML elements for both desktop and mobile views. The example below hides the third and fourth options, but you must inspect your site's code to find the correct selectors for your theme.
#lang_choice_1 option:nth-child(3),
#lang_choice_1 option:nth-child(4) {
display: none;
}
5. Using a Custom Dropdown Function
For more control, you can use the pll_the_languages() function directly in your theme's template files (e.g., header.php). Using the 'dropdown' argument is a common method to generate a select list.
<?php pll_the_languages( array( 'dropdown' => 1 ) ); ?>
You can then style this dropdown with custom CSS by targeting the generated class or ID.
When to Look Elsewhere
It's important to note that some advanced features related to the language switcher and its integration with page builders or online store functionality (WooCommerce) are only available in the commercial Polylang Pro extension. If your troubleshooting hits a wall and the feature you need is confirmed to be part of the Pro offering, that may explain the limitation you're encountering with the free plugin.
By methodically working through these steps—checking settings, testing for conflicts, managing cache, and using custom code—you can usually resolve most issues with the Polylang language switcher dropdown.
Related Support Threads Support
-
Disable specific plugin for a specific languagehttps://wordpress.org/support/topic/disable-specific-plugin-for-a-specific-language/
-
Exclude Learndash Courses from translationhttps://wordpress.org/support/topic/exclude-learndash-courses-from-translation/
-
Automatic show language selector popup with free/pro polylang plugin?https://wordpress.org/support/topic/automatic-show-language-selector-popup-with-free-pro-polylang-plugin/
-
How to keep the user language choice?https://wordpress.org/support/topic/how-to-keep-the-user-language-choice/
-
Checkbox “Hide URL … for default language” drops frequently …https://wordpress.org/support/topic/checkbox-hide-url-for-default-language-drops-frequently/
-
BUG: Secondary Menu – No Drop Downhttps://wordpress.org/support/topic/bug-secondary-menu-no-drop-down/
-
Display language switcher php code as a dropdown listhttps://wordpress.org/support/topic/display-language-switcher-php-code-as-a-dropdown-list/
-
Bug on lang select menu, using Breakdance Builderhttps://wordpress.org/support/topic/bug-on-lang-select-menu-using-breakdance-builder/
-
Alternate Language option on Same pagehttps://wordpress.org/support/topic/alternate-language-option-on-same-page/
-
Hide current language (lang switcher)https://wordpress.org/support/topic/hide-current-language-lang-switcher/
-
Language switcher vs cachehttps://wordpress.org/support/topic/language-switcher-vs-cache/
-
Polylang and Twenty twenty threehttps://wordpress.org/support/topic/polylang-and-twenty-twenty-three/
-
Display Selected Languages in Language Dropdown?https://wordpress.org/support/topic/display-selected-languages-in-language-dropdown/
-
Mobile showing languages that is hidden in the desktop versionhttps://wordpress.org/support/topic/mobile-showing-languages-that-is-hidden-in-the-desktop-version/
-
suggested language switcherhttps://wordpress.org/support/topic/suggested-language-switcher/
-
Can’t setup languageshttps://wordpress.org/support/topic/cant-setup-languages/
-
show all languages only shows primary languagehttps://wordpress.org/support/topic/show-all-languages-only-shows-primary-language/
-
Your Plugin Dropdown option doesn’t work on Footerhttps://wordpress.org/support/topic/your-plugin-dropdown-option-doesnt-work-on-footer/
-
memorizing the language that the user selected on the previous visit?https://wordpress.org/support/topic/memorizing-the-language-that-the-user-selected-on-the-previous-visit/
-
user selected language is not storing which can be use in emailhttps://wordpress.org/support/topic/user-selected-language-is-not-storing-which-can-be-use-in-email/
-
pll_current_language(https://wordpress.org/support/topic/pll_current_language/
-
Double language flag ?https://wordpress.org/support/topic/double-language-flag/
-
Filter: pll_preferred_language not workinghttps://wordpress.org/support/topic/filter-pll_preferred_language-not-working/
-
Dropdown does not use anchorshttps://wordpress.org/support/topic/dropdown-does-not-use-anchors/
-
Hide few languages from language selector in menuhttps://wordpress.org/support/topic/hide-few-languages-from-language-selector-in-menu/
-
Dropdown showing current language when disabledhttps://wordpress.org/support/topic/dropdown-showing-current-language-when-disabled/
-
Adding Hmong Languagehttps://wordpress.org/support/topic/adding-hmong-language/