Back to Community

Troubleshooting Common Polylang Language Switcher Issues

25 threads Sep 16, 2025 PluginPolylang

Content

Adding a language switcher to your WordPress site with the Polylang plugin is a common requirement, but it can sometimes lead to unexpected behavior. Based on community reports, here are the most frequent issues and how to resolve them.

1. The Dropdown Doesn't Work

A common problem is when the language switcher is added via PHP code (e.g., using pll_the_languages()) or as a widget, but the dropdown functionality fails to activate. This is often not a bug in Polylang but a conflict with your theme's styles or scripts.

Why it happens: Your theme's CSS might be overriding the necessary styles for the dropdown, or its JavaScript could be interfering with the switcher's interactivity.

How to fix it:

  • Check for JavaScript errors: Open your browser's developer console (F12) and see if any red error messages appear when you click the switcher. Errors here often point to a conflict with another script, like a jQuery library from your theme or another plugin.
  • Inspect the CSS: Use your browser's inspector tool to check if the dropdown <ul> element is being generated but is hidden due to a display: none; or overflow: hidden; rule from your theme.
  • Use the official widget: If you are coding it manually, try using the built-in Language Switcher widget instead, as it includes baseline styles and scripts for the dropdown.

2. The Switcher Overlaps Other Elements

Another frequent issue is the dropdown list overlapping with your site's menu or header, making it difficult to use.

Why it happens: This is almost always a styling issue related to CSS z-index and positioning. The theme controls the layout, and the switcher may not have a high enough z-index value to appear above other elements.

How to fix it:

  • Add custom CSS to increase the switcher's z-index and ensure it has a position value of relative or absolute. For example:
    .pll-switcher { 
        position: relative; 
        z-index: 9999; 
    }
  • Use your browser's inspector to identify the specific CSS classes applied to your switcher and adjust the positioning rules accordingly.

3. The Switcher Is Not Available in Menus or the Site Editor

Many users report they cannot find the option to add the language switcher to their navigation menu, especially in block-based themes like Twenty Twenty-Four that use the full Site Editor.

Why it happens: In the classic WordPress Customizer (Appearance > Menus), you must first enable the switcher in your screen options. In the new Site Editor, native support for the Polylang switcher may be limited as it relies on block functionality.

How to fix it:

  • Classic Menus: Go to Appearance > Menus. Click Screen Options at the top right and check the box for Language Switcher. It should then appear in the left-hand column for you to add to your menu.
  • Site Editor (Block Themes): The Polylang team suggests using a custom HTML block or a shortcode block to insert the switcher if a dedicated block is not available. You can use the provided PHP function or shortcode in these blocks.

4. Customizing the Look and Feel (CSS)

Users often want to change flags to classes, arrange items horizontally, add borders, or change colors.

Why it happens: Polylang outputs minimal inline styles to function. All advanced styling is intended to be handled by your theme's CSS or your own customizations.

How to fix it:

  • Horizontal List: To display flags or languages inline, target the list items with CSS:
    .pll-switcher li { 
        display: inline-block; 
        margin-right: 10px; 
    }
  • Replace Inline Flag Styles: To change the default inline styles on flags, you can use the pll_get_flag filter to modify the HTML output, replacing the style attribute with a CSS class.
  • Colors and Borders: Use your browser's inspector to find the correct CSS classes for your switcher's elements (e.g., links, dropdown background) and override them with your own rules in the Additional CSS section of your theme.

Need More Help?

Since front-end display and styling are primarily controlled by your WordPress theme, many layout issues are best diagnosed by checking your theme's documentation or seeking help from its support channels. For complex issues, enabling debug mode in WordPress can help identify underlying PHP errors.

Related Support Threads Support