Skip Navigation

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

Problem:
The client is experiencing issues with links not being translated correctly, resulting in 404 errors or linking to the wrong language version of the page.

Solution:
We recommend two approaches to resolve this issue:
1. As a long-term solution, add

<type="link">

to your existing XML configuration. This will ensure that links are correctly translated.
2. As a short-term solution, use machine translation for the URLs and manually edit the translations if they are incorrect.

We advise the client to implement the first solution for a permanent fix. However, it is important to note that updating existing pages that use shortcodes from the previous XML configuration will be necessary to make the changes effective.

If this solution does not seem relevant to your situation, please open a new support ticket with us.

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 30 replies, has 2 voices.

Last updated by Marcel 3 years, 7 months ago.

Assisted by: Marcel.

Author Posts
October 12, 2021 at 1:02 pm #9771721

henrikK-14

I am trying to:
Links are not always translated correctly (not linking correctly)

Link to a page where the issue can be seen:

Many images with links are not working (see categories in the middle of page)
hidden link

See images in top with links to new pages:
hidden link

I expected to see:
Link to the translated pages

Instead, I got:
for link 1) 404 error
for link 2) danish version of page (should have been EN or DE)

I have tried synching links, but it doesnt work.

Skærmbillede 2021-10-12 kl. 15.02.04.png
Skærmbillede 2021-10-12 kl. 15.01.10.png
October 13, 2021 at 8:57 am #9777857

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hi,

link 1)
You have spaces in your translated URL slugs that WP will convert to something like this (%20 = 1 space): hidden link

Please remove all spaces. Then the links will not point to 404.

link2)
Would you please check the slug translation in Products -> Categories? Is the affected category translated there, including a DK slug?

Best Regards
Marcel

October 13, 2021 at 9:01 am #9777881

henrikK-14

Thank you for replying

1) No there isnt.
This is the original lang/page: hidden link
No spaces. They also seem to work fine (some) in EN.. just not DE

2) Everthing has been translated, yes.

Best regards

October 13, 2021 at 9:07 am #9778017

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hi,

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to a testing site where the issue is replicated.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.

IMPORTANT
-Please make a backup of site files and database before providing us access.
-If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:
hidden link

Best Regards
Marcel

October 13, 2021 at 9:08 am #9778023

henrikK-14

1)
I see that i have A LOT of german/DE links that has this weird problem.

Both breadcrumbs, html text-links and the links described in this support ticket.
The links get a very weird URL for german version, as you said, even though everything is 100% translated and i used the "link" function in WPML.

Also, both some EN links and DE links are formatted wrong.
Some has spaces in translated links, others have weird symbols like you described.
Some has the correct /en/ or /de/ in the link, and others have not. Meaning that wpml will use the danish version of the link, not the translated version.

All these errors are present on all pages, but find look here as example:
DA (all correct) : hidden link
DE: hidden link
EN: hidden link

Best regards

October 13, 2021 at 9:09 am #9778029

henrikK-14

Hi. I cannot enter the details.
Need a private message box.

October 13, 2021 at 9:28 am #9778191

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hi,

once you reply, the private message will disappear. I reactivated the input field again for the next answer 🙂

October 13, 2021 at 11:09 am #9779353

henrikK-14

Here you go 🙂

October 13, 2021 at 1:01 pm #9781077

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hi,

the correct slug is included in the translated categories. The issue is a manually set link inside Divi (screenshot attached). This comes from a Global Layout, which was probably translated automatically without any context.

You can fix the URLs directly in the Blurbs in your affected Global Layout.

The slug "/de/plankentische" is defined on the permalink option of that page: hidden link. You can change it directly on that specific page.

Best Regards
Marcel

slug.png
October 13, 2021 at 1:05 pm #9781181

henrikK-14

Hi.
Its also on all "non-global" pages / areas.
The global feature is not a problem i think.

To test, i have no problem with just deleting the global function, and testing. Should i?

October 13, 2021 at 1:07 pm #9781183

henrikK-14

Seems like all links in divi blurb-module is always a problem in regard to correct linking, so is the CTA-module, and woo breadcrumbs are also have issues on some pages.

All most all regular html text links are also getting the "spaces" issue.

Actually its only the "button" links and the menu links that seems to work on all pages and all languages...

I have a custom XML configuration that are YEARS old, could this have any implications in this matter?

October 13, 2021 at 1:09 pm #9781211

henrikK-14

<wpml-config>
<shortcodes>
<shortcode>
<tag>et_pb_button</tag>
<attributes>
<attribute>button_text</attribute>
<attribute>button_url</attribute>
</attributes>
</shortcode>
<shortcode>
<tag>et_pb_cta</tag>
<attributes>
<attribute>title</attribute>
<attribute>button_text</attribute>
<attribute>button_url</attribute>
</attributes>
</shortcode>
<shortcode>
<tag>et_pb_code</tag>
<attributes>
<attribute>background_image</attribute>
<attribute>background_video_mp4</attribute>
<attribute>background_video_webm</attribute>
</attributes>
</shortcode>
<shortcode>
<tag>et_pb_blurb</tag>
<attributes>
<attribute>title</attribute>
<attribute>url</attribute>
<attribute>link_option_url</attribute>
</attributes>
</shortcode>
</shortcodes>
</wpml-config>

October 13, 2021 at 1:11 pm #9781215

henrikK-14
<wpml-config>
<shortcodes>
<shortcode>
<tag>et_pb_button</tag>
<attributes>
<attribute>button_text</attribute>
<attribute>button_url</attribute>
</attributes>
</shortcode>
<shortcode>
<tag>et_pb_cta</tag>
<attributes>
<attribute>title</attribute>
<attribute>button_text</attribute>
<attribute>button_url</attribute>
</attributes>
</shortcode>
<shortcode>
<tag>et_pb_code</tag>
<attributes>
<attribute>background_image</attribute>
<attribute>background_video_mp4</attribute>
<attribute>background_video_webm</attribute>
</attributes>
</shortcode>
<shortcode>
<tag>et_pb_blurb</tag>
<attributes>
<attribute>title</attribute>
<attribute>url</attribute>
<attribute>link_option_url</attribute>
</attributes>
</shortcode>
</shortcodes>
</wpml-config>
 
October 13, 2021 at 1:15 pm #9781251

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hi,

that has nothing to-do with the XML config itself. It seems more you translated the blurbs (via the global layout) over the machine translation, which messed it up because there is no context for the translation engine to separate between a regular slug and a regular word.

You can simply solve this by opening the translated global layout where the blurbs are created and translate the URL slugs manually. You can see the wrong link in "Module Link URL".

Best Regards
Marcel

October 13, 2021 at 1:16 pm #9781253

henrikK-14

Ok, but still.

What about all the other places, where the same problem occur but there is none globale sections?