Skip Navigation

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

Problem:
The client needed to set different slugs for a custom post type (CPT) archive page in different languages. The default slug was in Spanish, and translating it directly using WPML's String Translation caused issues, resulting in pages not relating properly and 404 errors.

Solution:
We informed the client that WPML currently has a limitation when it comes to translating the 'has_archive' option for a unique value, meaning that a direct translation of the CPT archive slug is not possible at this time. We provided a guide for a better understanding of this limitation:

We suggested that if the client enables the 'Has archive' and uses the default CPT's slug, they can then translate that slug from "WPML > Settings > Post Type Translation".

We also mentioned that our development team is aware of this issue and is working on a solution for a future version of WPML, but we do not have an estimated time of arrival for this update.

If this solution is not relevant to your case, either because it's outdated or not applicable, we recommend opening a new support ticket. 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. If you need further assistance, please contact us in the WPML 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.

Tagged: 

This topic contains 3 replies, has 3 voices.

Last updated by Prosenjit Barman 6 months, 2 weeks ago.

Assisted by: Prosenjit Barman.

Author Posts
May 8, 2024 at 11:22 am #15605691

lucap-5

I have an archive page with a custom slug, and I need to set a different slug for the other languages.
The default page slug is hidden link and, since it's in Spanish, I cannot leave it like that in all the other languages. I need a way to change it.

If I understood correctly, it's not really possible to translate an archive custom slug. I have tried doing that using the String Translation and now it's a mess, since I have pages that don't relate to one another properly.

I have hidden link in English and have created comparatore-autoclavi for italian. But I see that now I also have hidden link as well as hidden link. This last one, with the desired slug, goes to a 404 page. The other one works, but the related urls for the other languages go to a 404 error page.

How can I solve this mess?

Maybe the plugin https://wordpress.org/plugins/permalink-manager/ can be a possible solution?

Screenshot 2024-05-08 at 09.00.36.png
May 8, 2024 at 9:07 pm #15607862

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hi,

Welcome to the WPML support forum. Thanks for contacting us.

While waiting for one of my colleagues to help with this ticket, and based on what you've described, allow me to walk you through some initial debugging steps.

If your custom post type (CPT) is translatable in "WPML > Settings > Post type translations" you should be able to translate also the slug by clicking the link "Set different slugs in different languages".

I have attached an example with the CPT products for better understanding.

If I've misunderstood your issue, or if my suggestions didn't resolve your problem, could you please clarify or give more details. Don't hesitate to share screenshots or any information that could help us better understand the issue you're facing.

Looking forward to hearing back from you.

Nico

screenshot-2024.05.08-16_04_25.png
May 9, 2024 at 6:00 am #15608541

lucap-5

Hi Nicolas,
thank you for your reply.

I don't need to translate the CPT slug.

I have attached an example for better understanding: I am not looking for a way to translate the url custom format "modelos", what I need is a way to translate the <b>custom archive slug</b> "comparador-de-autoclaves"

Screenshot 2024-05-08 at 09.00.36.png
May 9, 2024 at 11:59 am #15610303

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
I hope you're doing well. I've taken over this ticket and would be happy to assist you further.

Thank you for sharing the screenshots. I see that you have set a unique slug for the CPT archive. I would like to inform you of a limitation with WPML concerning this setting. When the 'has_archive' option is set to a unique value, it cannot be translated directly as the support for a unique archive hasn't been added yet. Please check the guide below for a better understanding.

- https://wpml.org/documentation/support/translating-slugs-for-custom-post-type-archives/

Therefore, translating the CPT archive slug directly isn't possible for now. However, the development team is aware of this limitation and is actively exploring solutions. While we are expecting to solve this limitation in the future version of WPML, I do not have any ETA for this update.

However, if you just enable the 'Has archive' and use the default CPT's slug, you can then translate that slug from "WPML > Settings > Post Type Translation".

I hope you can understand. Please feel free to let me know if there is anything else if you need help with. I will be happy to assist.

Best regards,
Prosenjit

May 9, 2024 at 12:47 pm #15610673

lucap-5

Ok, it's clear, I am afraid I don't see any solution to this right now, since I need a different slug for the archive page...

Thank you Prosenjit