Closed radex02 closed 3 years ago
Describe the bug Posts of an hidden language are shown in the sitemap
To Reproduce Steps to reproduce the behavior:
Expected behavior Hidden languages shouldn't be shown in sitemaps
Additional context Weirdly enough, translated terms seem to already be hidden. I currently use this snippet to go around this issue
add_filter( 'rank_math/sitemap/entry', function( $url, $type, $object ){ if ($type !== 'post') return $url; $post_lang = apply_filters( 'wpml_post_language_details', NULL, $object->ID )['language_code']; $hidden_langs = apply_filters( 'wpml_setting', array(), 'hidden_languages' ); if (in_array( $post_lang, $hidden_langs, true ) || $post_lang == '') return false; return $url; }, 10, 3 );
Fixed in v1.0.67
Describe the bug Posts of an hidden language are shown in the sitemap
To Reproduce Steps to reproduce the behavior:
Expected behavior Hidden languages shouldn't be shown in sitemaps
Additional context Weirdly enough, translated terms seem to already be hidden. I currently use this snippet to go around this issue