Closed manuelaugustin closed 2 months ago
Please inform the customer of conversation # 826994 when this conversation has been closed.
Comments:
Tested this with latest WordPress 5.7.2, WPML SEO 2.0.0 and WPML 4.4.10 and the news-sitemap.xml still shows the same languages for all posts, whatever is configured in WPML as language.
This is David from the WPML compatibility team.
Some time ago I requested a new filter to address this issue (for reference, it was in https://github.com/Yoast/bugreports/issues/278)
This was the suggestion I made:
diff --git a/classes/sitemap-item.php b/classes/sitemap-item.php
index 1f5e7b5..aea09b5 100644
--- a/classes/sitemap-item.php
+++ b/classes/sitemap-item.php
@@ -143,7 +143,7 @@ class WPSEO_News_Sitemap_Item {
*/
private function build_publication_tag() {
$publication_name = WPSEO_Options::get( 'news_sitemap_name', get_bloginfo( 'name' ) );
- $publication_lang = $this->get_publication_lang();
+ $publication_lang = apply_filters( 'Yoast\WP\News\publication_language', $this->get_publication_lang(), $this->item );
$this->output .= "\t\t<news:publication>\n";
$this->output .= "\t\t\t<news:name>" . $publication_name . '</news:name>' . "\n";
I'm not sure if the code has changed, but we basically need a hook to adjust the language of a publication and we can take it from there.
Please inform the customer of conversation # 1147423 when this conversation has been closed.
Moved from https://yoast.atlassian.net/browse/IM-39
When using WPML, News SEO generates a news sitemap for each language which is great, however, they are not totally correct
For example, for these two articles:\ /my-article (English version)\ /es/mi-articulo (Spanish version)
The news sitemap for the English language includes both articles and the news:language is set to English for both of them
The news sitemap for the Spanish language includes both articles and the news:language is set to Spanish for both of them
WordPress 4.5.2\ Yoast SEO 3.2.5\ News SEO 3.2\ WPML Multilingual CMS 3.3.8