Skip to content Skip to sidebar

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.

This topic contains 5 replies, has 2 voices.

Last updated by gustavoC-15 3 years, 2 months ago.

Assisted by: Dražen.

Author Posts
July 11, 2022 at 6:55 pm #11645309

gustavoC-15

Hi,

I’m having an issue when translating posts (post type "post", not a custom post type) and using the custom permalink structure including the main language slug in there as the attachment (/propiedades/%postname%).

The problem is that I can’t see the option to translate this slug as it is possible with the custom post types (see attached).
So when translating to english, the permalink structure stays as "/en/propiedades/..." and we need it to be "/en/properties/..."

How can I do it?
Unfortunately to move all the content under the main post type "post" to a cpt is not an option for us right now 🙁

Btw, it works great when translating the base category slug ("propiedades/categoria" to "properties/category").

Thanks,
Gustavo.

image3.png
image2.png
image1.jpg
July 12, 2022 at 7:05 am #11647163

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello Gustavo,

for a slug of CPT to be translatable you need to set in the code you are using to use archive and define slug using rewrite.

WPML allows has_archive to be set to a string. However, if the string value is set to something other than rewrite['slug'], or the custom post type name slug is not set, the archive slug will not be translatable.

Please check the next docs for more info and examples:
- https://wpml.org/documentation/support/translating-slugs-for-custom-post-type-archives/

Hope it helps.

Kind regards,
Drazen

July 12, 2022 at 11:18 am #11649511

gustavoC-15

Hi Drazen,

Thanks for your reply.
As mentioned, this is NOT a custom post type, as the CPT are not the problem here (as per the shared attachment when translating the CPT “investment” slug from “/inversiones" to “/investors").

What I need to translate is the slug defined on the custom permalink structure for the native/reserved post type "post”.

I haven’t found it on the provided link, how can I do it?

Thanks again.
Gustavo.

July 12, 2022 at 12:11 pm #11650163

gustavoC-15

Drazen,

I have just found this related topic, created 2 years ago:
https://wpml.org/forums/topic/translate-base-standard-post-type-base-slug/

Can you please confirm if there is an approach to sort this on the current version?
Or the only way to translate the slug will be to create a CPT and move all the content under the default post type.

Thanks,
Gustavo.

July 12, 2022 at 1:10 pm #11651085

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello Gustavo.

thanks for getting back.

I checked further and it seems Custom Structure is not translatable, as it is supposed to be used by tags not strings for translation.

You can suggest this for a new feature via our next form and we will consider it:

https://wpml.org/suggest-a-new-feature-for-wpml/

As for a solution to your issue, the best and correct way would be to create a new CPT with a translatable slug and then translate it however you need.

I hope I was helpful. Don't hesitate to ask if you find any problems along the way, I'll gladly help you.

Regards,
Drazen

July 12, 2022 at 1:19 pm #11651117

gustavoC-15

Got it, so sadly we will need to move all the content to a new CPT.
I will submit a suggestion for this new feature, for sure.

Thanks!