Skip Navigation

Open

Topic Tags: Compatibility

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

Option 1

  • Go to Litespeed cache > Cache > Purge > Auto 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);	
    				}
    

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>