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.

Tagged: 

This topic contains 4 replies, has 0 voices.

Last updated by MG 5 days, 13 hours ago.

Author Posts
April 17, 2026 at 2:22 pm #17977096

MG

Regarding your changelog:
- Fixed an issue where the post slug appeared as not translated when using the "Translatable - use translation if available or fallback to default language" translation setting.

Your code for this change:
if ( $this->sitepress->is_display_as_translated_post_type( $post->post_type ) ) {
$ld->language_code = apply_filters( 'wpml_current_language', null );
}

We have translated the woocommerce shop page slug in WCML > Store URLs like:
German (default language): webshop
French: shop

We are using Yoast sitemap, which lists all posts and their translations in the same sitemap.
With 3.5.0, the French products use the correct SHOP slug:
hidden link

With 3.5.1, the product sitemap uses the German slug WEBSHOP (because the current language while showing the sitemap is German (default))
hidden link

Maybe the sitemal shoud be excluded here?

April 21, 2026 at 10:06 am #17983514

Juan de Paco
Supporter

Hello.

Thanks for reaching out, and sorry for the delay. I am going to consult with our developers and get back to you with the information that they provide.

Regards.

April 22, 2026 at 4:40 pm #17988522

Juan de Paco
Supporter

Hello again.

Thanks for your patience.

Our developers were able to reproduce your issue and are already working towards a solution.

For reference, the issue was originated in the fix introduced to solve this problem: https://wpml.org/fr/forums/topic/product-base-slug/:
- A post type set as "Translatable - use translation if available or fallback to default language", with archives, and a translated slug for each language.
- When visiting the archives in a secondary language, posts of that type that were not translated were using a permalink with the untranslated, original post type slug. Only translated posts were showing the right permalink.

Our developers will take care of the regression affecting sitemaps. While this happens, and as a temporary workaround, you might want to comment out the line in the piece of code that you shared:

//$ld->language_code = apply_filters( 'wpml_current_language', null );

We will keep you posted once we have a permanent solution.

Thanks in advance.

April 30, 2026 at 8:42 am #18004852

Juan de Paco
Supporter

Hello. Thanks for your patience.

Our development team has completed their analysis, and they will include a fix for this problem in our next release for WPML.

Please let me know if you need a patch based on that permanent solution or whether the workaround provided in my previous comment is enough for your current case.

Regards.

May 7, 2026 at 8:16 pm #18021404

Juan de Paco
Supporter

Hello.

I am happy to share that this issue has been fixed in WPML 4.9.3, which was just released.

Thanks!

May 11, 2026 at 7:36 am #18026001

MG

Thank you, WPML String Translation 3.5.2 fixed it.