<b>Background of the issue: </b>
Hi, I am trying to translate links for a new post type. I set the post type to 'translatable' and created posts with translations. Initially, the translate setting switched back to 'not translate', but I resolved this by adding a configuration to the WPML XML Configuration: <custom-types> <custom-type translate="1">details</custom-type> </custom-types>.
I also set specific fields to translate links: <custom-fields> <custom-field action="translate" translate_link_target="1">block_button_url</custom-field> <custom-field action="translate" translate_link_target="1">content_must_knows</custom-field> </custom-fields>.
<b>Symptoms: </b>
Some links on translated posts are using the English URL instead of the German URL, even when the links are inside fields set to translate links.
<b>Questions: </b>
How can I solve the issue of links on translated posts pointing to the English URL instead of the German URL?
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.
On the live site, I clicked the "unlock" option in the translator and corrected the link manually. It did not change in the frontend yet. Perhaps because of caching, but it's already 16 hours ago, and still nothing changed. Did this work for you on the staging site?
Even if it works, how come WPML failed to identify the translated custom posts? If everything is setup correctly, I suppose this is a bug?
I found that the link was not translated into German, so I’ve updated it for you as shown in the attached screenshot. The link "Alle Preise und Rabatte finden Sie hier" is now working at hidden link
If you’d like us to investigate further why the links are not pointing to the translated page automatically, please replicate the issue on our sandbox site hidden link . You can install the necessary plugins there to reproduce the problem. Then, I will escalate this to our 2nd Tier Support for further investigation.
I translated on the live site and couldn't see the translation in the frontend. But it works now, so I must have done something wrong before.
So, unlocking and translating the links manually works. But that's too much work going forward. The links need to be translated automatically, just like all links to other post types.
I reproduced the same issue on the sandbox site. I created a custom post here: hidden link
I translated it too.
On this page, the link to that post remains English: hidden link
There is one other strange thing: the custom post type doesn't even load in the frontend. This is a correct URL, but it throws a 404 error page: hidden link
This might be a sandbox-specific problem, because it works fine on our website.
WordPress does "see" the custom post type: it pops up in the dropdown when creating a link to it. So I would think that WPML should be able to get the German URL.
Just a wild guess: maybe WPML can't deal with the slug "details"?