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.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Eran Helzer 1 year, 11 months ago.

Assisted by: Eran Helzer.

Author Posts
May 29, 2023 at 1:12 pm #13732615

maS-36

We discovered that if you choose Make 'Posts' translatable, the categories are correctly copied.
If we choose Make 'Posts' appear as translated, the post in the translated language appears as Uncategorized.

Here is the video: hidden link

There was a previous ticket but we were out of office and it was closed.

May 30, 2023 at 11:25 am #13739067

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

What you are describing is not the correct behavior of WPML. I see that in your video you show that changing the Translatable setting affects that but it should not be so.
I tried replicating your scenario but in my case it works as it should.

1) Can you please try translating the Test Category by going to WPML -> Taxonomy translation, and then translate the post?

2) Is there any custom code you added to the website that could be causing this?

3) Can you please share your WPML debug info? Here is a short explanation on how to do it:
https://wpml.org/faq/provide-debug-information-faster-support/

Please update me with this info so I can help better.

Regards,
Eran

May 31, 2023 at 11:19 am #13746743

maS-36

1 - Same result, it lands on uncategorized category in the translated language.
2 - Noting I can see, this site is simple.
3 - Attached.
Thanks

June 1, 2023 at 5:30 am #13750759

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Thanks for getting back and taking time to follow the suggestions. Well, this is definitely not the correct behavior of WPML.

I suspect that either:
- Some setting is not configured correctly
- Some plugin is conflicting with WPML
- Some custom code is causing this

I suspect this because on a clean installation with only WPML what you described does not happen.

Can you please check if the issue happens when only WPML plugins are activated, all other plugins are disabled, and while using the WP default theme? Please make a backup before proceeding.

Regards,
Eran

June 1, 2023 at 7:38 am #13751377

maS-36

Hi Eran, we have a lead, it's the LiteSpeed Cache plugin.

Can you try to reproduce on your side? We are using basic LiteSpeed Cache settings and we choose this plugin because its certified by WPML: "LiteSpeed Cache is a recommended plugin thanks to its commitment to continued compatibility and partnership with WPML. LiteSpeed Cache is fully compatible with WPML."
Cheers

June 1, 2023 at 11:48 am #13753501

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I replicated this in a minimal setup and there really is a compatibility issue there. When both String Translation and LiteSpeed Cache are enabled, it is exactly like you show in your video.

I have escalated this to our Compatibility Team. For now, the solution I can suggest for you is that you do all your translations with Post translation settings set to "only show translated items", which we know copies categories correctly. Then after finishing your translations change the setting.

I will update you on any progress regarding this issue as soon as I can.

Regards,
Eran

June 6, 2023 at 8:54 am #13776515

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Update regarding the LiteSpeed Cache compatibility issue.

Our development team have found that this is related to a known issue that was previously escalated.
There are two possible workarounds you can implement:
- Go to LiteSpeed Cache > Cache > Purge > Auto Purge Rules For Publish/Update and disable the "Term archive (include category, tag, and tax)" option
- Open the *wp-content\plugins\litespeed-cache\src\purge.cls.php* file and replace line 1172:

$terms = get_the_terms($post_id, $tax);

With this code:

// WPML Workaround for compsupp-6805
				$terms = '';

				if( class_exists('SitePress') ){
					$default_language = apply_filters('wpml_default_language', NULL );
					$current_language = apply_filters('wpml_current_language', NULL );
					
					if ( $default_language === $current_language ) {
						$terms = get_the_terms($post_id, $tax);	
					} 
				} else {
					$terms = get_the_terms($post_id, $tax);	
				}

Both options fix the issue with categories not being copied to translated posts.
Please make sure to have a backup of your site before proceeding with these workarounds.

This is the errata, you can stay updated through here also to know when the issue will be resolved:
https://wpml.org/errata/litespeed-cache-categories-are-not-synchronised-to-translated-posts/