This thread is resolved. Here is a description of the problem and solution.
Problem:
The client wants internal links on a page to be automatically translated from Dutch to English when translating the page. It works on the staging site but not on the live site.
Solution:
We recommend the following steps to resolve the issue:
1. Ensure a complete backup of the site, including the Database.
2. Access the site's database via the Hosting panel or a Database plugin.
3. Navigate to the
wp_icl_translation_status
table and execute the following query:
UPDATE wp_icl_translation_status SET links_fixed = 1 WHERE links_fixed = 0 AND status = 10;
(Note: The table prefix "wp" might differ in your database)
4. After running the query, create a new post or product and include a link to an internal page or post, ensuring that the linked page/post is properly translated.
5. Translate the new post or product and then check its translation on the frontend.
6. For all existing pages and posts, visit WPML > Settings > Translate link Target and press the Scan now and adjust links button once.
If this solution does not seem relevant to your issue, please do not hesitate to 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: Exception
This topic contains 13 replies, has 2 voices.
Last updated by Prosenjit Barman 1 year ago.
Assisted by: Prosenjit Barman.
Author | Posts |
---|---|
November 30, 2023 at 3:31 pm #14964695 | |
marcoB-110 |
Tell us what you are trying to do? It IS working on the stage-site, but not on our live site. How come? |
December 1, 2023 at 1:09 pm #14973007 | |
Prosenjit Barman Supporter
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hello There, I understand what you're looking for and will try my best to assist you in this matter. Please note that all internal links should automatically update in other languages, based on the availability of their translations. If you find that the links are not updating as expected, it's advisable to check the corresponding page or post to confirm that it has been accurately translated into the other languages. Also, make sure that the translated page or posts are not saved in 'Draft'. To check that, please follow the steps below. - Switch to a secondary language from the WordPress dashboard. I'd also like to suggest that when linking to a post/page, use the relative URL format instead of the full URL. For example- While linking to the "contact" page, rather than using 'hidden link', simply use '/contact'. Using the relative URL format often resolves issues related to links pointing incorrectly in other languages. You can check this article to know more about the URL formats: hidden link After updating the URL format in the default page, make sure to update the translation as well. Please check and let me know the update. I will be happy to help if you need further assistance in this matter. Best Regards, |
December 4, 2023 at 3:00 pm #14988501 | |
marcoB-110 |
Hello Prosenjit, I can conclude this does work with a page or post. But we also have another problem: if we make a new product (in Dutch: our default language) and we use internal links within the "Product description" text field. Then those links are not translated automatically if we translate the page to English (with the WPML Translation Editor), even if we use relative links, like you just told us. What goes wrong and how can we solve this aswell? Kind regards. |
December 5, 2023 at 5:31 am #14992809 | |
Prosenjit Barman Supporter
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hello There, If you've included a URL in the product description using the Anchor tag (<a>), it's quite possible that the custom link won't be automatically translated. Generally, only links that are inserted through a dedicated link field within modules or elements(such as a "button" element), are automatically updated depending on the translation. However, the custom link you added in the description can be translated from the WPML Translation Editor. To understand the process, please check the guide below. In the translation field, simply add the link to the translated version of the page/post. I hope you can understand. Please let me know if you need further assistance in this matter. I will be happy to help. Best regards, |
December 5, 2023 at 9:08 am #14994453 | |
marcoB-110 |
Hello, Yes I know that links can be translated through the WPML Translation Editor. But according to my client, the links in the "Product description" text field of a product page were somehow automatically translated if he translated the page from Dutch to English in his previous WooCommerce website. I know it's possible to do this automatically at "Translate Link Targets" by pressing the button at “Scan now and adjust links”, but how is this possible fully automatically by only translating a product page? Also, regarding the topic of the use of relative URL's as links in text of a product or page. My client rather uses the default WordPress search function for a generating a link in Gutenberg-editor for a page or post because my client says this was more reliable with translating. I notice WordPress makes a absolute URL of this link. But why shouldn't this default WordPress search function not work for translation on the live-site? |
December 6, 2023 at 4:20 am #15003545 | |
Prosenjit Barman Supporter
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hi There, If the link to another post is added using WordPress's default link insertion tool, it's not necessary to translate the link through the Translation Editor. The link will be updated automatically in other languages depending on the translation. In my development environment, this update occurs automatically. Please refer to the attached screenshot for clarification. If you can verify that the linked post is translated properly into other languages, kindly provide the link to the specific product where I can see the issue. I will examine it and advise you on the next steps. Best regards, |
December 7, 2023 at 3:20 pm #15018303 | |
marcoB-110 |
Hello Prosenjit, Yes the link is not translated if the link has been made through the default link insertion tool on the live-site. You can check it here: hidden link. You will probably redirect to hidden link because we use a Geotargeting plugin that redirects all users from outside the Netherlands to the English side of of the page. On hidden link you will see a link called "Cras justo odio". If you click on that you will probably be redirected to the English side of the "bestellen-en-betalen" page because of the Geotargeting plugin. Just check the link with the mouse hover, it says "hidden link" while it should say "hidden link". This does work on our stage-site. |
December 8, 2023 at 11:00 am #15024903 | |
Prosenjit Barman Supporter
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hello There, I can see that the "bestellen-en-betalen" page is correctly translated into English. So, if you have linked the page to the main page, the English version of the main page should be pointed to the English version of 'bestellen-en-betalen' page. However, I'd like to point out that when it comes to automatically updating links, there are two important factors to consider. If the linked page was translated after the translation of the main page, where the link is added, then the translated version of the main page might not show the updated, translated link. This is because the translated link is generated later. For example- If the English version of the "bestellen-en-betalen" page is created after translating the "testpagina3" page, then you might not see the translated link of "bestellen-en-betalen" in the English version of "testpagina3" In that case, you just need to update the "testpagina3" and its translation for once. Additionally, another aspect to consider is that if you duplicate the default page to generate its translation, you may find that the link in the translated version remains unchanged as the link will be copied, just like other content. In that case, you need to update the link manually. But, since you're adding the translation through ATE, this factor may not be relevant here. If you have translated the linked page after translating the main page, then you must need to update the main page and its translation. The link will be then updated automatically. But, if you've translated the linked page before adding the translation for "bestellen-en-betalen" page, then a closer inspection will be required to understand the root cause. 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 have a testing site where the issue is replicated. You will find the needed fields 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 Looking forward to your response. Best Regards, |
December 12, 2023 at 10:47 am #15044405 | |
marcoB-110 |
The page: hidden link was already translated correctly to hidden link a long time ago. But as you notice the link (Cras justo odio) within this page: hidden link is not translated correctly on hidden link. But this link should be correctly translated according to what you said in your recent reply. Ofcourse I can't give you access to the live-site, but I can give you access to our stage-site, but that defeats the purpose because I already said that this problem does not occur on the stage-site. So if you have access to the stage-site then the pages will show links that are correctly translated. But there is another problem that looks like the problem we were discussing before in this topic. On the stage-site links are not being translated on the product pages. This problem happens on the stage-site aswell on our live-site. Can you check that problem on our stage-site? Maybe the solution for the "product-page link problem" is also the solution for the "page / post link problem". Can you enable the privat box so I can give you the login data of our stage-site? |
December 13, 2023 at 5:36 am #15050685 | |
Prosenjit Barman Supporter
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hi There, The problem affecting the links on the Product pages appears to be connected to similar issues on other pages. It's likely that by resolving the issue on the Product page, we'll be able to rectify the issue on the other pages too. I kindly request you to share the access to your Staging site. The provided access must include admin privileges, as this will enable me to conduct a thorough investigation of the issue without any limitations. I have enabled the private box for you so that you can securely share the access. Looking forward to your response and thank you for your cooperation. Best regards, |
December 16, 2023 at 7:42 am #15076635 | |
Prosenjit Barman Supporter
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hi There, I examined the "Testproduct 6 – Nederlands" product and observed the issue. I tested it in a minimal environment, but the problem persisted. Interestingly, in my development environment, when I attempted to replicate the issue in the same manner, everything functioned correctly there. The links are getting updated automatically. Notably, when I used the "Translate link target" button, the URL updated in other languages immediately. So, it seems the custom links on the posts aren't been processed properly by WPML, which I suspect happening due to any particular settings. For further investigation, I've taken a copy of your site and will deploy it on my development environment. My next steps will be to check if there is any settings that are interferring with the custom links and also if there is any adjustments are made in Database. If required, I will also escalate this issue to our 2nd tier team for further investigation. For now, please use that tool to adjust the links in each language. Additionally, I have noticed that due to not defining suffiecient memory limit for WordPress, it is also not possible to access the "WPML > Packages". Upon allocating 1024M of memory limit, I was able to access that section. Please ensure to assign proper memory limit by following the guide below. As soon as I have more info on that, I will surely inform you. Thank you for your petience and kind cooperation in this matter. Best regards, |
December 18, 2023 at 7:40 am #15080739 | |
Prosenjit Barman Supporter
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hi There, Upon investigation, I found that the status of all internal links in the database was set to non-updatable (0). This setting is likely the reason why internal links in the translated posts are not updating automatically. Could you please try the following steps to see if they resolve the issue? - Ensure a complete backup of the site, including the Database, is taken. UPDATE wp_icl_translation_status SET links_fixed = 1 WHERE links_fixed = 0 AND status = 10; (Note: The table prefix "wp" might differ in your database) I hope the links will be updated correctly for future and existing posts after these adjustments. Feel free to let me know if you need further assistance. I will be happy to help. Best regards, |
December 18, 2023 at 10:37 am #15082477 | |
marcoB-110 |
Hello Prosenjit, First of all, thanks for looking into the website itself. You already applied "UPDATE wp_icl_translation_status SET links_fixed = 1 WHERE links_fixed = 0 AND status = 10;" to our stage-sit, right? I noticed if I make a product page on the stage-site, the links I am using in the product description are translated. It looks like the SQL code is working, nice. I have two questions: Kind regards. |
December 19, 2023 at 5:49 am #15088375 | |
Prosenjit Barman Supporter
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hi There, Yes! I already have executed the SQL query on your staging site. Please find the answers to your questions below. 1- The SQL query is run on a table set up by WPML, and it aims to enable automatic updates of links. It doesn't have any negative effects. Its primary function is to update links in other languages to match the available translations of corresponding posts or pages. 2- I believe there's no need to run that SQL for future posts. However, if the issue reoccurs (which seems unlikely), simply execute the query and then click the "Scan now and adjust link" button in WPML > Settings. Doing so should immediately resolve the issue. I hope you can understand. Feel free to let me know if you need further clarification or assistance in this matter. I will be happy to help. Best regards, |