WPML

Overview of the Issue

If you are using LiteSpeed Cache plugin, you may encounter an issue translating posts. Specifically, when users create and translate a new post, the translated post does not retain the category from the original post.

Workaround

This issue is fixed in WPML 4.6.7. Updating solves it on your site, so you only need this workaround if you can’t update yet.

Option 1

  • Go to Litespeed cacheCachePurgeAuto Purge Rules For Publish/Update page.
  • Disable the Term archive (include category, tag, and tax) option.
Or:

Option 2

Please, make sure of having a full backup of your site before proceeding.
  • Open …/wp-content/plugins/litespeed-cache/src/purge.cls.php file
  • Look for line 1172.
  • Change:
    $terms = get_the_terms($post_id, $tax);
  • For
    // 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);	
    }

All known issues

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.