I have a case of an old site that is causing me problems.
It's an old wordpress site, which has several pages, with an option to change languages. But, the system makes that for each page, it keeps the same URL (the choice of the language is kept in the cookies).
For example, the catalog page has this URL (whether it is for English, French, Spanish,...)
But some pages are only available for some languages.
Let's imagine, I have a "catalog" page accessible only for English and Spanish, but not for French.
Should I make a sitemap_index.xml page this way ?
<url>
<loc>https://www.my-website.com/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://www.my-website.com/" />
<xhtml:link rel="alternate" hreflang="es" href="https://www.my-website.com/" />
<xhtml:link rel="alternate" hreflang="fr" href="https://www.my-website.com/" />
</url>
<url>
<loc>https://www.my-website.com/catalogue/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://www.my-website.com/catalogue/"
<xhtml:link rel="alternate" hreflang="es" href="https://www.my-website.com/catalogue/" />
/>
</url>
Or, i should create each sitemap of each language
Sitemap: https://www.my-website.com/sitemap_index_fr.xml
Sitemap: https://www.my-website.com/sitemap_index_en.xml
Sitemap: https://www.my-website.com/sitemap_index_es.xml