[Resolved] Wrong post permalink with custom post type and custom taxonomie
This thread is resolved. Here is a description of the problem and solution.
Problem: You are trying to translate the slug of your custom post type (CPT) 'Offer', but despite following the documentation and saving the permalinks again, the slug is not translated, resulting in 404 errors when accessing the links. Solution: If your CPT 'Offer' is created using custom code, you should first edit your code to change the slug. After modifying the slug, navigate to WPML-> Settings in your dashboard and translate the new slug, ensuring it differs from the previous translations. This adjustment should resolve the issue with the untranslated slug and the subsequent 404 errors.
If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. Additionally, we highly recommend 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 at https://wpml.org/forums/forum/english-support/.
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.
Background of the issue:
I am trying to translate the slug of my custom post type (CPT) 'Offer' on my site hidden link. I have read many posts on this topic and followed the documentation at https://wpml.org/documentation/support/translating-slugs-for-custom-post-type-archives/. I tried saving the permalinks again but it did not help. The Redis plugin is NOT installed.
Symptoms:
The slug of my CPT is not translated, leading to 404 errors when accessing the links.
Questions:
How can I translate the slug of my custom post type 'Offer'?
Why are the links leading to 404 errors despite following the documentation?
Thanks for contacting WPML forums support. I'll be glad to help you today.
I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP) Preferably to a test site where the problem has been replicated.
Your answer will be private, meaning only you and I can access it.
❌ Please backup your database and website ❌
✙ I need your permission to deactivate and reactivate the plugins and themes and change site configurations. This is also why the backup is critical.
✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.
Thanks for the access details. I think this issue happens because the "Offers (moff_post_offerta)" and "Offers (moff_cat_offerta)" slugs are identical in all languages.
I suggest changing the post type slug in the default language along with its translation and check the issue.
thank you for your reply. Where exactly should I look? I translated moff_cat_offer and moff_post_offer in WPML --> Settings but the problem remains. I attach screenshots.
Although I am sure I have tried this several times, the solution trivially was to change the slug translation in WPML --> Settings --> Post Types Translation to something else and then update the permalinks in Settings --> Permalinks
I'm really disappointed that I wasted 2 days on such nonsense and wasted your time too!