Skip Navigation

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

Problem:
You are trying to change the WPML URL structure from query parameter URLs (e.g., ?lang=en) to subdirectory URLs (e.g., /en/), but are experiencing issues with broken links leading to 404 errors or incorrect redirections.
Solution:
If you're experiencing this issue, we recommend you first make a full website backup. Then, follow these steps:
1. Navigate to WPML > Settings.
2. At the bottom of the page, click on Translate link targets.
This should update all internal links to translated pages in EN on your website.

If this solution does not resolve your issue or seems irrelevant due to being 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 problem persists, please open a new support ticket at our support forum 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 1 reply, has 0 voices.

Last updated by Lucas Vidal de Andrade 3 weeks, 1 day ago.

Assisted by: Lucas Vidal de Andrade.

Author Posts
January 15, 2025 at 3:05 pm #16597856

royv-8

Background of the issue:
I am trying to change the WPML URL structure from query parameter URLs (e.g., ?lang=en) to subdirectory URLs (e.g., /en/). After making this change, I am experiencing issues with broken links. The issue can be seen on this page: hidden link (en zou hidden link moeten zijn).

Symptoms:
Certain links to translated pages are broken and result in 404 errors or incorrect redirections. This persists even after resaving permalinks, clearing caches, and verifying .htaccess settings.

Questions:
How can I fix the broken links after changing the WPML URL structure?
What steps should I take to ensure the translated pages load correctly with the new subdirectory structure?

January 15, 2025 at 5:47 pm #16598697

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

Thank you for sharing the details. If I understood it right, some internal links are still using the old structure, thus leading to a 404. Is that correct?

If that's the case, please make a full website backup and try the following:

1. Go to WPML > Settings
2. At the bottom of the page, click on "Translate link targets"

That should update all internal links to translated pages in EN on your website.

If I misunderstood the issue, or if the solution doesn't work, please let me know so I can continue support.

Thank you.