wordpress-seo
wordpress-seo copied to clipboard
Duplicated translated homepage on Yoast SEO sitemap
Please give us a description of what happened.
I'm using WPML to manage the translations of some pages of a website. One of these pages is the homepage which is translated to de, pt-br, es and fr. I create the copies of the homepage from the English version, which originally had a slug. When I create and publish the translated pages they are duplicated on my sitemap (which is generated by Yoast SEO) as follows:
https://mywebsite.com/
https://mywebsite.com/de/
https://mywebsite.com/pt-br/
https://mywebsite.com/es/
https://mywebsite.com/fr/
https://mywebsite.com/de/original-slug-of-english-page
https://mywebsite.com/pt-br/original-slug-of-english-page
https://mywebsite.com/es/original-slug-of-english-page
https://mywebsite.com/fr/original-slug-of-english-page
Note: the https://mywebsite.com/original-slug-of-english-page is not on the sitemap.
I've read some similar reports, for example this one.
Please describe what you expected to happen and why.
The sitemap should only contain:
https://mywebsite.com/
https://mywebsite.com/de/
https://mywebsite.com/pt-br/
https://mywebsite.com/es/
https://mywebsite.com/fr/
Used versions
- WordPress version: 5.4.1
- Yoast SEO Premium version: 13.4.1
- WPML version: 4.3.11
- Yoast SEO Multilingual: 1.1.1
Yoast SEO Multilingual has integration code which includes all languages in SQL query. This plugin excludes all translated front pages via the filter wpseo_exclude_from_sitemap_by_post_ids (to avoid duplicates). Some plugin or custom code may overrides results of this filter.
I'd like to see order of URLs (en home page should be first, somewhere in middle probably /../original-slug-of-english-page and translated home pages at the end). Could you make screenshot of page sitemap?
Yoast SEO Multilingual has integration code which includes all languages in SQL query. This plugin excludes all translated front pages via the filter wpseo_exclude_from_sitemap_by_post_ids (to avoid duplicates). Some plugin or custom code may overrides results of this filter.
I'd like to see order of URLs (en home page should be first, somewhere in middle probably /../original-slug-of-english-page and translated home pages at the end). Could you make screenshot of page sitemap?
Thank you @stodorovic.
I would prefer not to share a screenshot of the sitemap, but I will replicate here the order:
https://mywebsite.com/
https://mywebsite.com/de/original-slug-of-english-page
https://mywebsite.com/pt-br/original-slug-of-english-page
https://mywebsite.com/es/original-slug-of-english-page
https://mywebsite.com/fr/original-slug-of-english-page
https://mywebsite.com/de/
https://mywebsite.com/pt-br/
https://mywebsite.com/es/
https://mywebsite.com/fr/
Also, I can't use wpseo_exclude_from_sitemap_by_post_ids since the duplicated pages have the same ID.
Based on you feedback, these pages are populated from main sitemap SQL query. WPML adds custom join/where which includes all languages (MySQL table wp_icl_translations). I think that duplicated pages have different post IDs.
Yoast SEO Multilingual uses wpseo_exclude_from_sitemap_by_post_ids (classes/class-wpml-wpseo-xml-sitemaps-filter.php) to exclude all translated pages. It's possible that 3rd plugin (or custom PHP code) breaks this filter. I've similar results when I remove this filter.
Other possibility is that relations in table wp_icl_translations aren't good, but you should see similar issues somewhere else.
If you have enough knowledge then it's possible to add PHP constants which turn on more debugging. You will see SQL query which you can run (eg. in phpMyAdmin) and see more details.
Sorry for the long wait @stodorovic @dariaknl. I'll provide feedback once I get back to work on this.
Is this issue still valid (with Yoast 14.3)?
I haven't updated yet @Djennez, I will left here the feedback once I update. In the meantime I manually removed the links using a custom filter.
I can confirm that it still happens on 14.3 @Djennez
@Djennez I am having exactly this same issue with Yoast (version 22.7) and WPML. Please can this be fixed? @rgllm how did you manually remove the links? Maybe I can do that in the meantime while we wait for an official fix.