<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"?
I regret any inconvenience caused, but to proceed with troubleshooting, I kindly ask for a snapshot of the site. Alternatively, with your permission, I can create one myself. For this purpose, I typically recommend using the free plugin "Duplicator." If you're already familiar with Duplicator (https://wordpress.org/plugins/duplicator/), please skip the following steps and simply send me the archive file you downloaded.
To guide you further, please adhere to these instructions:
1. View the Duplicator instructions video: hidden link
3. If the archive file exceeds 400MB, please use Duplicator's file filters to exclude cache, wp-uploads directory, media, and archive files.
Once you have the archive file ready, kindly share the link with us. You can utilize platforms like Google Drive, Dropbox, or similar for file sharing, as the snapshot file might be large.
Please note that your next reply will be private, visible only to you and me. You can paste the file link there. Rest assured that once the issue is resolved, I will delete the local site.
I installed Duplicator on the staging site and excluded /uploads/ and some db tables. It's still too big. Please go into the site as I suppose you can work around this limit. I don't know what else to do.
Thanks for your reply. It's 52gb hidden link . Not sure if this is feasible, but I will escalate this to our 2nd Tier Support for further assistance. I will come back to you once I've feedback.
I think I saw it go down to 1.5 Gb when excluding /uploads/ and 3 database tables ending with "_cloned" in their name. But I don't know what else to exclude and still have a useful backup for your colleagues. I hope they can figure it out.
Thanks for your reply. Did you fix all the links in the translated German language? I've checked a couple of travel tickets in the German language and all links are pointing to the correct translated page. Could you recheck?
No, I haven't made changes. Links to the new post type are still incorrect; here are some examples:
- On hidden link, the link in the button "Alle Preise und Rabatte ansehen".
- On hidden link, the first two links under "Swiss Half Fare Card – Kurzüberblick".
By the way, I removed the Duplicator backup file because it was 50 Gb in size and causing disk issues on the server. It should be possible to create a much smaller backup with the exclusions I mentioned in my previous post. I will also try to shrink the /uploads/ directory, but excluding it is better.
The topic ‘[Closed] Links to a new post type are not translated’ is closed to new replies.