Skip Navigation

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 3 replies, has 2 voices.

Last updated by Andrey 4 years, 8 months ago.

Assisted by: Andrey.

Author Posts
October 16, 2020 at 1:35 pm #7244595

ricardoL-7

Feature request

October 18, 2020 at 9:54 pm #7253327

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Laura has handed your ticket to me. I hope this is fine.

I do see the point you are trying to achieve by adding taxonomy term to the URL. But the way you are doing is not recommended by the WordPress Codex. At least I haven't found any mention of this (https://developer.wordpress.org/reference/functions/register_post_type/). It is more like a custom workaround to achieve the goal.

I would suggest doing such by using rewrite rules ( add_rewrite_rule() ), as WP recommends.
https://codex.wordpress.org/Rewrite_API/add_rewrite_rule

Since the solution is not standard, I assume it might have compatibility issues that we can't fix right now or fix at all.

I hope this helps.

October 19, 2020 at 11:02 am #7257219

ricardoL-7

Hi,

So you´re saying that if i use rewrite rules, wpml will translate the slugs and add them to the url without getting a 404?? I need to be sure before starting making the changes to the code

October 19, 2020 at 11:41 am #7257499

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

I cannot be sure 100%, but doing things that document by WordPress should play nicely with WPML rather than something that isn't intended.

Based on the casess I have seen before, the code with proper rewrite rules worked with WPML.