[ad_1]
Hi,
I see that you set up the language code in WPML as kr-KR or kr_KR. Why did you not use the standard ko_KR notation?
The sitemap plugin will take the first part of the language code to use in the news sitemap. This means the issue would be solved by setting the language code to ko_KR in WPML… Is that an option for you? You’d need to set up a general 301 redirect from all /kr/* requests to /ko/* to not loose ‘old’ traffic of course…
If this is not desirable, you can use the filter described on https://premium.status301.com/knowledge-base/xml-sitemap-google-news/filter-hooks/xmlsf_news_language/ to replace any “kr” with “ko” in the news sitemap. You can put this PHP code in any Code Snippets plugin:
add_filter(
'xmlsf_news_language',
function( $lang ) {
return ( 'kr' === $lang ) ? 'ko' : $lang;
},
100
);Hope that helps 🙂
