Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
If you're experiencing an issue where WPML automatically adds a trailing slash before the hash anchor in URLs (e.g., changing https://mysite.com/en/contact#reservation to https://mysite.com/en/contact/#reservation), this might be due to WPML's handling of internal links and your site's permalink settings.
Solution:
We have identified that this behavior occurs when a translated page exists with the same slug, and WPML processes these links to match the site's permalink structure, which includes trailing slashes. If you remove the trailing slash from your permalink settings, the link should work as expected. You can see a demonstration here: https://www.awesomescreenshot.com/video/52908603?key=80683bec3e7cbe9340b3143d5cf08325.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket for further assistance.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 2 replies, has 0 voices.

Last updated by Dražen 1 week, 6 days ago.

Assisted by: Dražen.

Author Posts
May 16, 2026 at 7:19 pm #18040577

Pierre

Hi,
I have a very specific URL rewriting issue with WPML that I can't resolve despite extensive troubleshooting. I have spent over 4 hours debugging this with Claude Opus 4.7 before reaching out to support.
My setup :
- WPML with manual translation (ATE disabled)
- All translations done directly in the Classic WordPress Editor (Text/HTML mode)
- No Gutenberg blocks, no page builder (no Elementor, no Divi, no WPBakery)
- All page content is raw HTML written manually
- Custom theme based on GeneratePress (child theme)
The issue : On my multilingual site (FR source, EN/NL/ES translations), when I save a translated page containing the link hidden link, WPML systematically rewrites it to hidden link (adding a slash before the hash anchor).
Why this is strange : This only happens with the /contact slug. Other similar links on the same page are saved correctly without any rewriting :
hidden link : saved correctly
hidden link : saved correctly
hidden link : becomes /en/contact/#reservation
Important question : Is it required to have all pages translated in all languages for the URL conversion to work correctly ? I notice that the /contact page is one of the few pages that I have translated in EN, while pages like /certification/ and /bieres/ don't have EN translations yet but their URLs are preserved correctly. Could the existence of a translation (vs. its absence) be triggering different URL handling logic ?
What I've tested :
- Direct SQL modification works, but WPML rewrites the URL on next save (proving it's a save-time hook, not display-time)
- Page Contact EN exists and is correctly linked as translation of Contact FR
- Renaming the Contact FR slug doesn't change the behavior
- WPML cache cleared via Troubleshooting (cache, ghost entries, etc.)
- Tested with Bit Form plugins disabled : no change
- Tested with Rank Math : no redirection rules involved
- No Sticky Links plugin installed
- Permalink structure is /blog/%postname%/
Affected pages : The rewriting happens on every page containing this specific link (Our Menu, Homepage, etc.) when saved.
I have two other production sites using WPML with similar setups (also using manual translation in Classic Editor, no builders) and this behavior doesn't occur. Could you help identify what's specific about the /contact slug that triggers this rewriting ?
Thanks in advance.
Pierre

May 18, 2026 at 8:23 am #18041923

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Thank you for your patience.

I was able to reproduce the issue on a clean sandbox site and identify under which conditions it happens.

The behavior occurs when a translated page exists with the same slug, in which case WPML automatically rewrites the URL by adding a trailing slash before the hash anchor.

I have escalated this further to our 2nd tier/development team for additional investigation and confirmation.

I will update you again as soon as I have more information.

Regards,
Drazen

May 25, 2026 at 9:37 am #18057703

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

I checked this further with our 2nd tier team.

What happens here is expected behavior from WPML when using manual translation with the WordPress Editor. WPML automatically processes valid internal links and rebuilds them according to the site's permalink structure.

Since your website permalink settings currently use trailing slashes, WPML rewrites:
hidden link

to:
hidden link

If the trailing slash is removed from permalinks settings, the link works as expected.

Video: hidden link

At the moment this is not considered a bug, but rather part of WPML's automatic internal link handling behavior for consistency with the site's permalink structure.

Please try and let me know what do you think.

Regards,
Drazen