1

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

1 Answer 1

1

Neither approach will work the way you want it to work.

If the default language is English, that is the only language Google will use to rank you. You can of course also rank in Spain or France if Google believes that English content is relevant to the query.

If you want your Spanish and French content to count in Google, you will need to make it available under separate URLs.

In general, hreflang is not needed when your website is in English, Spanish, and French. hreflang is needed if you have an English website for the US and another one for the UK. Or a Spanish version for Spain and another one for Mexico. In that case, hreflang would make sure the English US-site is only ranking in the US, etc.

I take it your goal is this?

In English-speaking countries, the English version should rank. In Spanish-speaking countries, the Spanish version should rank. Then you can just use the lang or XML:lang attribute in HTML. Or let Google figure out the language. But again: first these pages would need to have individual URLs per language.

Of course you can add hreflang in such a setting. But since it can be a lot of effort, depending on the CMS, it is often not worth it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.