How to Fix Polylang Logo Display and Link Issues on Your Multilingual Site
Content
If you're using the Polylang plugin to create a multilingual WordPress site, you might encounter issues where your logo doesn't display correctly or its link doesn't point to the right language homepage. This is a common problem that stems from how themes and Polylang handle media and URL structures. Let's explore the root causes and the most effective solutions.
Why Do These Logo Problems Happen?
These issues typically occur for two main reasons:
- Media Synchronization: Polylang's media synchronization feature can sometimes cause the logo to disappear in one language while appearing in another. This feature is designed to share media items across languages, but it can interfere with how themes set the logo.
- Theme and Plugin Interaction: Many themes store the logo selection in the WordPress Customizer. By default, Polylang does not translate these Customizer settings, meaning the same logo (and its link) is used for all languages unless specifically configured otherwise.
Common Solutions for Logo Display Issues
Solution 1: Check Media Synchronization Settings
If your logo disappears in one language but appears in another, the first place to check is Polylang's media synchronization settings.
- Go to your WordPress admin dashboard.
- Navigate to Languages → Settings.
- Click on the Media tab.
- Review the synchronization options. If 'Synchronize media' is enabled, try disabling it to see if this resolves the issue. This setting can sometimes cause conflicts with how logos are displayed across different languages.
Solution 2: Use a Custom Code Snippet for Logo Translation
For themes that store the logo in the Customizer (like Twenty Twenty or Astra), you can use a custom function to display different logos per language. The following code snippet is a common approach found in community discussions. Add this to your child theme's functions.php file:
function custom_polylang_multilang_logo( $value ) {
if ( function_exists( 'pll_current_language' ) ) {
$logos = array(
'en' => '2400', // Replace with your English logo attachment ID
'fr' => '2402', // Replace with your French logo attachment ID
);
$default_logo = $logos['en'];
$current_lang = pll_current_language();
if ( isset( $logos[ $current_lang ] ) )
$value = $logos[ $current_lang ];
else
$value = $default_logo;
}
return $value;
}
add_filter( 'theme_mod_custom_logo', 'custom_polylang_multilang_logo' );
Important: Remember to replace the attachment IDs ('2400', '2402') with the actual media IDs of your logos. You can find a media file's ID by going to your Media Library, clicking on the image, and looking at the number in the URL (.../wp-admin/upload.php?item=YOUR_ID).
Solution 3: Manually Code the Logo in Your Header Template
For maximum control, you can edit your theme's header.php file (always use a child theme to avoid losing changes during updates). This method uses a simple conditional check to output different logos based on the language.
<?php
$lang = pll_current_language();
if ($lang == 'fr') { ?>
<img class='logo' src='<?php echo esc_url(get_template_directory_uri()); ?>/images/logo-fr.jpg' alt='French Logo' />
<?php } else { ?>
<img class='logo' src='<?php echo esc_url(get_template_directory_uri()); ?>/images/logo-en.jpg' alt='English Logo' />
<?php } ?>
This approach gives you direct control over the image source and its alt text for each language.
Fixing the Logo Link (Pointing to the Wrong Homepage)
A frequent issue is the logo linking to the default language's homepage instead of the current language's homepage. This is often because the theme hardcodes the home URL.
The most reliable fix is to ensure your logo link uses the home_url() function, which Polylang automatically filters to return the correct language homepage. In your header.php file, the logo link should look like this:
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
<!-- Your logo image code here -->
</a>
If your theme uses a different method to generate the homepage link, you may need to modify it to use home_url().
Conclusion
Logo issues with Polylang are almost always a theme integration challenge rather than a bug in the plugin itself. By checking your synchronization settings, implementing a custom function, or directly editing your header template, you can gain control over how logos are displayed and linked across your multilingual site. Always remember to clear your cache after making any of these changes and test the results on the front end of your site.
Related Support Threads Support
-
Polylang installed, logo is no longer displayedhttps://wordpress.org/support/topic/polylang-installed-logo-is-no-longer-displayed/
-
Change favicon in second languagehttps://wordpress.org/support/topic/change-favicon-in-second-language/
-
different logos for different languageshttps://wordpress.org/support/topic/different-logos-for-different-languages-2/
-
Logo translating hack not workinghttps://wordpress.org/support/topic/logo-translating-hack-not-working/
-
logo link in second languagehttps://wordpress.org/support/topic/logo-link-in-second-language/
-
Changing the Logo for translated pageshttps://wordpress.org/support/topic/changing-the-logo-for-translated-pages/
-
Same logo for both languageshttps://wordpress.org/support/topic/same-logo-for-both-languages/
-
Header image URL won’t show in translationshttps://wordpress.org/support/topic/header-image-url-wont-show-in-translations/
-
Logo per languagehttps://wordpress.org/support/topic/logo-per-language/
-
Logo header site link without trailing slashhttps://wordpress.org/support/topic/trailing-slash-11/
-
How to make the internal links point to the URL of the translated post?https://wordpress.org/support/topic/how-to-make-the-internal-links-point-to-the-url-of-the-translated-post/
-
Header logo URL points to default language on all languageshttps://wordpress.org/support/topic/header-logo-url-points-to-default-language-on-all-languages/
-
Logo Link always links to english on my multi language sitehttps://wordpress.org/support/topic/logo-link-always-links-to-english-on-my-multi-language-site/
-
Theme – Bridge / Qodehttps://wordpress.org/support/topic/theme-bridge-qode/
-
Change Logo in Header while Switching Languagehttps://wordpress.org/support/topic/change-logo-in-header-while-switching-language/