Back to Community

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:

  1. 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.
  2. Plugin or Theme Conflicts: Other plugins or your theme's code can interfere with how TranslatePress modifies links and menus.
  3. 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.
  4. 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:

  1. Temporarily switch your theme to a default WordPress theme like Twenty Twenty-One.
  2. Deactivate all plugins except TranslatePress.
  3. Check if the menu and links work correctly.
  4. 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.

  1. Go to Settings → TranslatePress → General.
  2. Scroll to the Miscellaneous section.
  3. Check the box for Force language in custom links.
  4. 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