Skip Navigation

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.

Our wait time is higher than usual, please make sure you are meeting the minimum requirement - https://wpml.org/home/minimum-requirements before you report issues, and if you can take a look at current Known Issues - https://wpml.org/known-issues/. Thank you.
Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: Asia/Singapore (GMT+08:00)

Tagged: 

This topic contains 17 replies, has 0 voices.

Last updated by Kor 6 hours, 50 minutes ago.

Assisted by: Kor.

Author Posts
April 11, 2025 at 8:48 pm #16924409

hayesP

Background of the issue:
I am trying to add Spanish translations to an existing English site and created the Spanish pages using the English content as a base (by copying content from the English page onto the Spanish, then adding the translated text). As a result the English URLs are still in the Spanish content. WPML seems to be trying to update the English URLs on the frontend without us doing anything, but that does not seem to always work. Additionally, the "Scan now and adjust links" button on the Settings page says that it made changes to 0 links (or does nothing). Link to a page where the issue can be seen: hidden link

Symptoms:
For URLs with a depth of 1 (like hidden link), only the first depth 1 URL on the page is translated correctly. All further depth 1 URLs are given the same translated URL as the first depth 1 URL on the page. URLs with a depth greater than 1 (like hidden link) are translated correctly.

Questions:
How can I ensure all English URLs are correctly translated to Spanish URLs?

April 15, 2025 at 1:01 am #16931409

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for reaching out. If you're using custom links, you'll need to manually translate them, as detailed in this guide: https://wpml.org/faq/how-to-translate-links/.

I'm currently unable to load your website. Could you please check its accessibility?

April 15, 2025 at 1:02 pm #16934165

hayesP

The site is currently up and should be accessible.

The provided guide says nothing about "custom links". We have seen that guide, and it says "There is a known issue with translating internal links inside buttons, calls to actions, and other similar blocks. While we fix this, please ask our support for help."

This is only for internal links on the website. External links should remain the same, and that is the behavior we are seeing. The "Adjust Links Feature" does nothing.

And yes, we can go through and manually adjust the pages to have the correct urls in the content. However the automatic pointing of internal links is broken and cannot seem to be turned off, and so until we can go in and manually update all of the urls across the approximately 131 pages, all of those pages have incorrect links.

April 15, 2025 at 2:07 pm #16934524

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.

Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.

Your upcoming reply will be treated with confidentiality and will only be visible to you and me.

✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.

April 15, 2025 at 5:15 pm #16935670

hayesP

FTP access is not possible. Additionally the client is currently reviewing the site, and there is user data that should not be exposed to a 3rd party.

April 15, 2025 at 5:36 pm #16935708

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply. You can clone the site to another staging site and then remove all sensitive data from the site so that I can check this out for you. Please let me know how it goes.

April 15, 2025 at 7:04 pm #16935938

hayesP

This is not possible from our end at this time. There is not client approval to spend time on creating another copy of the site.

We can offer a screen share, or can provide our current setup instructions for how we've configured WPML.

Isn't there a known issue with translating internal links inside buttons, calls to actions, and other similar blocks? Is there something from that that we can explore?

April 16, 2025 at 12:53 am #16936386

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply. I've prepared a sandbox site here hidden link and could you please replicate the issue over there so that I can check what's going on? You can install the required plugins and themes.

April 16, 2025 at 2:51 pm #16939696

hayesP

Thank you for setting up that sandbox site. We have replicated the base issue there turning on only the WPML plugin and no others. You can see the page demonstrating the issue here: hidden link

We've tried to document the links and their status on the page in a fairly clear manner but some more details:

On the page you'll see that some links are getting converted automatically to the correct translated page, but others are not. Specifically the 1st link on the page gets correctly converted from its English page to the Spanish equivalent. However, all of the rest of the links to existing English pages are being changed to be the same as the first link on the page as opposed to their correctly translated pages. Whatever link is put first gets correctly converted but then all other converted links inherit that conversion instead of their correct one.

Links to non-existent (404) pages on the site are correctly unchanged, as are direct links to Spanish versions of pages.

We dove into the guts of WPML and the issue appears to be ultimate related to `get_matching_page_displayed_as_translated()` in the `WPML_Name_Query_Filter_Translated` class. This class appears to store an array of `$this->pages_to_langs` which builds up with each URL in the content to be converted. However the logic there returns the first match on the first URL in that array instead of the correct one.

April 16, 2025 at 3:16 pm #16939795

hayesP

I also wanted to add that (after saving permalinks) this is only impacting depth 1 links. Links with a depth greater than 1 are also correctly converted to their translated equivalent. You can see this in the two depth 2 examples provided on the sandbox site page.

April 17, 2025 at 7:06 am #16942098

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for creating that example on the sandbox site. I will check now.

April 17, 2025 at 4:36 pm #16945248

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience. I've escalated this to our 2nd Tier Support and I will come back to you once I've feedback.

April 22, 2025 at 2:29 pm #16955720

hayesP

Kor, thank you for escalating this to Tier 2. Please let us know if we can provide anything else that may be useful. We are hoping to launch our translated site in the next week or two, but do need to get this bug resolved so that we don't have to try to go through all of the pages and manually update hundreds of links.

We did try the "scan links and update them" button in the WPML settings, but that did not change any links.

April 22, 2025 at 2:35 pm #16955744

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

Your report is still in the queue for review. I will come back to you once I hear from them. Sorry for the delays and the inconvenience.

April 28, 2025 at 12:41 pm #16974857

hayesP

Kor, Is there any update on the timing for review and/or resolution of this bug? We are at the stage of having everything completed for our translated site except for this issue. Obviously this is a fairly significant blocker to deploying though as numerous links are incorrect on almost every page of the site.