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.

This topic contains 11 replies, has 3 voices.

Last updated by tommyJ-4 1 year, 4 months ago.

Assisted by: Bruno Kos.

Author Posts
December 14, 2023 at 11:00 am #15062451

tommyJ-4

In order to make all links point to the correct translated page I ran the dedicated function for this purpose under "Settings". After doing this I saw that all the corrected links became absolute URL's. This won't work when I go live with the site from the staging to the production site.

Can you advice me how to make all links relative?

translate_links.PNG
December 15, 2023 at 11:48 am #15071613

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hi,

Welcome to the WPML support forum. Thanks for contacting us.

We are currently handling a high amount of ticket and while waiting for one of my colleagues to help with this ticket, please allow me to walk you through some initial debugging steps.

WPML will be able to translate only absolute links, that's a normal behavior. If you want to use relative links you will have to translate them manually.

From what I understand, the reason for using relative links is a migration from staging to production right? In that case you can "search and replace" domains either by doing a query in the database or by using a plugin such as "Better Search and Replace".

Please note that it's just a recommandation, this is not one of our plugin. Make a full backup of your database before.

December 19, 2023 at 6:50 am #15088633

tommyJ-4

Hello again
Do you mean that the function in question is not supposed to point the links to the translated page, but instead they are translated, as if it was normal text we are talking about? If a site has a couple of thousand of links, do you mean that I am supposed to go through all of them manually?

translate_links.PNG
December 19, 2023 at 11:56 am #15092037

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

Can you check this? Your particular case may benefit from this plugin:
https://wpml.org/documentation/getting-started-guide/sticky-links/

However if that wouldn't work, after migration you can replace them using tool such as:
https://wordpress.org/plugins/better-search-replace/

Also, if you migrate the site using tool such as https://wordpress.org/plugins/duplicator/, during deployment it would search and replace any old URLs with new domain.

December 19, 2023 at 12:19 pm #15092159

tommyJ-4

Hello again Bruno 🙂
As you can see I have all sorts of problems, also with links. I discovered just now that on for example this page:
hidden link
... you will find for example this link:
hidden link
The problem with that link is that the parent page is not reflected in the URL. So if I insert the parent page's slug, like this:
hidden link
... the link works again and opens the right page.
Can you advice what to do in order to make the links "complete" on translateg pages and not exclude parts in the URL.
So the actual translated page contains the parent page's slug, but not the link, pointing towards that page.

December 19, 2023 at 1:10 pm #15092867

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

Would you be willing to provide me with WordPress and FTP credentials so I could investigate the issue directly?

I need to check how the original page is set to understand how to get this resolved. So in a nutshell, on a button (such as on my screenshot) the URL is missing the parent slug? Is this the only example or the website is affected in various locations?

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

I marked your next reply as private so that you can safely add credentials.

wrong url.jpg
December 19, 2023 at 2:03 pm #15093679

tommyJ-4

I also found one page with links that lead to the Swedish page, not the translated page in English:
hidden link
On that page there are links that are correct, including the parent page's slug, and other that does not.
This is a correct link:
hidden link
This link not correct:
hidden link (it should be hidden link)

December 19, 2023 at 4:38 pm #15095309

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

I checked 2 of these pages:

hidden link
hidden link

I modified one of these links to be dynamic and resaved it and then resaved translation (to see if that would be an issue), but it seems to have fixed all of the URLs so it would not be about this.

The second page I just changed the title of the original page, resaved it, removed that change and resaved the translation.

And this seems to have fixed URLs on hidden link as well.

But I am not sure if there is a troubleshooting function that would help us fix them all.

dynamic url.jpg
December 20, 2023 at 6:57 am #15098041

tommyJ-4

Hello
OK, so I tried to do the same thing on this page:
hidden link
The page contained one link that missed the URL part /calibration/.
I clicked on "Edit page" and changed the title, saved the page, removed the change and saved the page again. Then I clicked "Edit translation" and clicked the button "Complete" at the bottom right side of the screen. And then as by magic the link was correct.

I guess I can do this manually on the most important pages.

This seem to be the same solution as you gave me yesterday in a chat support for products where hundreds of "related" upsell products were listed. In fact, in that case it is enough to just enter "Edit translation" and Press "Complete" to fix the problem on most pages.

So my wish list for this Christmas is a function where I can list all translated pages, check them for batch action, and select "Complete", to fix all those pages at once. Can I please have that ? 🙂

December 20, 2023 at 7:54 am #15098485

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

In fact what we experience in your case is not normal course of action, but in order to provide a permanent solution that will not require saving, we would need to have some sort of a way reproduce the issue from the beginning (for example having an original page with such URLs, creating new translation and observing what happens).

Given that the translations are already there but were not completely published for some reason, it may be difficult to do. The issue may be coming from compatibility with the theme, some other plugin, perhaps server timeout where translations were not properly pulled in time for some reason, etc.

December 20, 2023 at 8:26 am #15098793

tommyJ-4

One more thing with links... On this page:
hidden link
... the "Read more" link (place the mouse on the images to see the link), leads to the Swedish page.
But if you open the page in Edit mode and look at the link, it leads to the English version. I have tried the trick to save and resave, with no luck this time.

Link_in_English_in_edit_page.PNG
December 20, 2023 at 8:39 am #15098915

tommyJ-4

Now suddenly the links shows in English after I removed a shortcode on that page and resaved. So all good.