Fixing Language Switcher and Menu Link Issues in TranslatePress
Content
Many users of the 'Translate Multilingual sites – TranslatePress' plugin encounter issues with their navigation menus and language switcher links after setup or migration. These problems can range from links not translating correctly, to menus displaying in the wrong language, or even entire menu items disappearing. Based on common community reports, this guide explains why these issues happen and provides the most effective troubleshooting steps.
Common Menu and Link Translation Issues
- Menu links do not change to the correct language version when clicked.
- Language switcher flags or links do not work after migrating a site.
- Menu items appear or disappear incorrectly on untranslated pages.
- Anchor links (e.g., #section) break when using a non-default language.
- Special characters (like ®) in menu labels break the link in translated versions.
Why Do These Problems Occur?
These issues typically stem from a few key areas:
- Migration Changes: Moving a site from a local (development) environment to a live server can change database references, breaking dynamic menu items like the language switcher.
- Plugin or Theme Conflicts: Other plugins or your theme's code can interfere with how TranslatePress modifies links and menus.
- Link Format: Using relative paths (e.g., /about-us/) instead of absolute paths (e.g., https://yourdomain.com/about-us/) can cause links to lose their language context.
- Plugin Settings: Certain crucial settings, like 'Force language in custom links,' may be disabled.
How to Troubleshoot and Fix Menu Link Issues
1. Recreate Menu Items After Migration
If your language switcher or dynamic menu items show as "invalid" after migrating your site, the simplest fix is often to delete them and recreate them on the live server. The database IDs for these items change during migration, causing broken links.
2. Perform a Conflict Test
A conflict with your theme or another plugin is a frequent culprit. To test for this:
- Temporarily switch your theme to a default WordPress theme like Twenty Twenty-One.
- Deactivate all plugins except TranslatePress.
- Check if the menu and links work correctly.
- If they do, reactivate your plugins and theme one by one, testing after each, to identify the source of the conflict.
Note: It is highly recommended to do this on a staging site, not your live production site.
3. Use Absolute URLs in Menus
For custom links, especially anchor links (e.g., #contact), always use the full absolute URL. A relative link like /about/#team will often break. Instead, use https://yourdomain.com/about/#team. This ensures the language code (e.g., /en/) is preserved correctly.
4. Enable 'Force Language in Custom Links'
This is a critical setting in TranslatePress that forces all custom links in your menus to maintain the selected language.
- Go to Settings → TranslatePress → General.
- Scroll to the Miscellaneous section.
- Check the box for Force language in custom links.
- Save your changes.
5. Check for Special Characters
Menu labels containing special characters (e.g., ®, ™, &) can sometimes cause the link to break in translated languages. If possible, try rewriting the label to avoid the special character or use its HTML entity code (e.g., ® for ®).
When These Fixes Might Not Apply
It's important to note that some advanced menu functionality is not part of the free version of TranslatePress. The ability to show or hide specific menu items based on language, for example, requires a paid add-on. Discussions about these paid features are not permitted on free support forums.
By methodically working through these steps, you can resolve the majority of menu and link translation issues. If problems persist after trying these solutions, the 'Translate Multilingual sites – TranslatePress' team recommends providing specific details, including screenshots or a screencast video, to help the community better understand the unique scenario.
Related Support Threads Support
-
Language switcher – Invalid menu items after migrationhttps://wordpress.org/support/topic/language-switcher-invalid-menu-items-after-migration/
-
hreflang problemhttps://wordpress.org/support/topic/hreflang-8/
-
Links in azbukahttps://wordpress.org/support/topic/links-in-azbuka/
-
Custom menu link in different languageshttps://wordpress.org/support/topic/custom-menu-link-in-different-languages/
-
Translation of URLs and change of images (FREE version)https://wordpress.org/support/topic/translation-of-urls-and-change-of-images-free-version/
-
Table of Contents anchor/hash links only working in original languagehttps://wordpress.org/support/topic/table-of-contents-anchor-hash-links-only-working-in-original-language-2/
-
Seo description for language in custom linkshttps://wordpress.org/support/topic/seo-description-for-language-in-custom-links/
-
Added 3 new languages to my website but they refuse to appear in the menuhttps://wordpress.org/support/topic/added-3-new-languages-to-my-website-but-they-refuse-to-appear-in-the-menu/
-
Link to Donation Site doesn´t workhttps://wordpress.org/support/topic/link-to-donation-site-doesnt-work/
-
Displaying a menu item ONLY in one languagehttps://wordpress.org/support/topic/displaying-a-menu-item-only-in-one-language/
-
Can not click link back to original languagehttps://wordpress.org/support/topic/can-not-click-link-back-to-original-language/
-
Trouble with Menu and link When the option No translatedhttps://wordpress.org/support/topic/trouble-with-menu-and-link-when-the-option-no-translated/
-
menu links inherit the language code in their urlhttps://wordpress.org/support/topic/menu-links-inherit-the-language-code-in-their-url/
-
Missing region-independant link for that languagehttps://wordpress.org/support/topic/missing-region-independant-link-for-that-language/
-
Errorhttps://wordpress.org/support/topic/error-1945/
-
Disappearing menu linkshttps://wordpress.org/support/topic/disappearing-menu-links/
-
Special Char in Navigationhttps://wordpress.org/support/topic/special-char-in-navigation/
-
Elementor menu anchor do not work in other languageshttps://wordpress.org/support/topic/elementor-menu-anchor-do-not-work-in-other-languages/
-
Menu language doesn’t changehttps://wordpress.org/support/topic/menu-language-doesnt-change-2/
-
Links in elements are not converting into Secondary language.https://wordpress.org/support/topic/links-in-elements-are-not-converting-into-secondary-language/
-
default English language menu’s link corruptedhttps://wordpress.org/support/topic/default-english-language-menus-link-corrupted/
-
How to remove trailing slash on anchor linkshttps://wordpress.org/support/topic/how-to-remove-trailing-slash-on-anchor-links/
-
Gray edit iconshttps://wordpress.org/support/topic/gray-edit-icons/
-
Translate previous / next texts in the menu inside individual blog postshttps://wordpress.org/support/topic/translate-previous-next-texts-in-the-menu-inside-individual-blog-posts/