Skip Navigation

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

Problem:
The client was facing issues with product category and tag links not correctly displaying in French and German versions on their multilingual website. Despite resaving permalinks and adjusting WPML settings, the links would revert to English or not direct correctly.
Solution:
We advised the client to manually translate the links by editing the homepage translations and searching for "HTTP" to ensure all links are translated. This approach resolved the issue. It's important to note that while WPML attempts to adjust internal URLs automatically, in some cases, such as with shortcodes or Elementor widgets, manual translation is necessary. For further guidance on translating links, visit this link.

If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. We also advise 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. For further assistance, please visit our support forum.

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

Last updated by Marsel Nikolli 11 months ago.

Assisted by: Marsel Nikolli.

Author Posts
August 12, 2024 at 12:05 am #16060163

davoodB

Background of the issue:
I am trying to ensure that the product category and tag links on my multilingual website correctly display in the French and German versions, referring to the appropriate categories and tags in these languages. This includes links in the top left part of the website home page ("Nos bijoux"), the collection section ("Collections Gisoo"), categories with SVGs under the collection part, and the categories with SVGs (using an HTML block) at the top of my Shop Page.

I recently changed the default language from English to French, added a directory for the default language, and I am updating content in English with the expectation that these links will automatically translate and function correctly in French and German. For example, when clicking on "Boucles d'oreilles" in the French version, I should be directed to mysite/fr/categorie-produit/boucles-doreilles/ instead of the English version mysite/en/product-category/earrings/. The links should remain stable in the translated languages after using WPML's "Translate Link Targets" feature.

Despite my efforts, including clearing caches, syncing WPML settings, and manually translating link strings, the links often still direct users to the English version of the pages instead of the French or German versions. After using the "Translate Link Targets" feature, I managed to get the German category links to display correctly on the homepage, but the problem for German links persists elsewhere. The issue is especially prominent with the links in both German and French at the top of my Shop Page, where I have the jewelry categories displayed with their SVG icons. There, only the "Bracelet Rigide" category in French sometimes works correctly, while the other links do not.

Symptoms:
Product category and tag links often redirect to the English version of the pages instead of the intended French or German versions.

Questions:
How can I ensure that all product category and tag links consistently redirect to the correct French and German versions across the entire website?
What might be causing the links to revert to the English version even after using the "Translate Link Targets" feature or after manually translating link strings?

August 13, 2024 at 8:23 am #16065191

Marsel Nikolli

Hi,

Thank you for contacting WPML Support, I will gladly help you.

* Please go to WP-Admin -> Settings > Permalinks and resave the permalinks. After, clear the website's cache, and check if the issue persists.

- Could you please tell me how you are translating those sections?

- Does it happen that once one of the links is working correctly, after some time it doesn't anymore (it switches to the English version)?

Looking forward to your reply,
Marsel

August 13, 2024 at 11:25 am #16065885

davoodB

Hi Marsel,

Thank you for your response.

I followed your advice and resaved the permalinks, but unfortunately, it didn’t resolve the issue.

To answer your questions:

"How am I translating those sections?" I typically translate pages by clicking on the "+" buttons and using WPML's Advanced Translation Editor. I haven’t specifically translated the links through the editor; they usually work fine by using WooCommerce Multilingual & Multicurrency. Initially, my URLs were structured as mysite/product-category/earrings, but after adding a directory for the default language, I edited the pages to add /en/ to the links in the original language and changed all category links to mysite/en/product-category/earrings. However, I don't believe this is the root of the problem, as I've tested adding product category and tag links in different areas of the homepage and encountered the same issue.

"Do the links switch back to English after working correctly?" Yes, this is what’s happening. For example, right now after resaving the permalinks, I noticed that the links on the homepage in the German version switched back to the English version.

Additionally, I’d like to mention that, mysteriously, since yesterday, the "Boucles d'oreilles" category link in the French language is now correctly directing to the French category page.

Also, it's perhaps worth mentioning that after initially encountering this problem, I noticed that in WPML's Settings > Taxonomies Translation > Product categories (product_cat) was set to "Translatable (use translation if available or fallback to default language)." I changed it to "Translatable (only show translated items)," but this didn’t solve the issue either.

I appreciate your continued assistance with this issue.

Best regards,
Dave

August 13, 2024 at 1:25 pm #16066637

Marsel Nikolli

Hi Dave,

Thank you for the update.

I would need temporary access to your website to investigate this issue and understand it better.

Please fully back up your site (files and database) and confirm it in your next reply.

I would need to access your site's WP-admin.
Your next reply is set to private for you to provide the username and password details.

Thanks,
Marsel

August 13, 2024 at 2:17 pm #16066866

Marsel Nikolli

Hi,

Thank you for the access, I was able to check the website.

Please check the instructions on this link on how to translate the links.

I've checked your homepage, and if you edit the translations of the homepage and search for "HTTP" you'll see that not all the links show translated, please check and try to translate and check if the issue persists.

Let me know how it goes,
Marsel

Screenshot 2024-08-13 155553.png
August 13, 2024 at 10:49 pm #16068163

davoodB

Hi Marsel,

Thank you for checking the website and providing the instructions.

I followed your advice and translated the links manually by searching for "HTTP" in the homepage translations, and it has successfully solved the problem.

I do have a question:

Is this the normal procedure for translating links? Do I always need to manually translate links in this way whenever I enter a new internal link?

I'm particularly curious because, as I mentioned earlier, there were instances where the product category and tag links suddenly started showing correctly in the relevant language without me having to translate them in the editor.
Furthermore, I only faced this issue with product category and tag links. I haven’t had this problem with other types of internal links, such as FAQ page links or other general page links.

Thank you again for your assistance, and I look forward to your clarification.

Best regards,
Dave

August 13, 2024 at 11:10 pm #16068202

davoodB

Hi Marsel,

Thank you for checking the website and providing the instructions.

I followed your advice and translated the links manually by searching for "HTTP" in the homepage translations, and it has successfully solved the problem.

I do have a question:

Is this the normal procedure for translating links? Do I always need to manually translate links in this way whenever I enter a new internal link?

I'm particularly curious because, as I mentioned earlier, there were instances where the product category and tag links suddenly started showing correctly in the relevant language without me having to translate them in the editor.
Furthermore, I only faced this issue with product category and tag links. I haven’t had this problem with other types of internal links, such as FAQ page links or other general page links.

Thank you again for your assistance, and I look forward to your clarification.

Best regards,
Dave

August 14, 2024 at 8:21 am #16069227

Marsel Nikolli

Hi Dave,

I am glad to hear that your issue is resolved.

Normally WPML will attempt to adjust internal URLs as much as possible but in some cases, the URLs are not adjusted, for example: in a shortcode or Elementor widget. In such cases, you need to translate them manually using the Advanced Translation Editor as you did.

The reason why some of the links started showing correctly might be because somehow they were translated from WPML -> String translation or directly in the HTML block you are using.

I hope you find this information helpful, please don't hesitate to contact us if you have any questions or need further assistance.

Kind regards,
Marsel