I have multiple translations of each page on my site. Example:
https://www.example.com/something
(English – default)https://www.example.com/en/something
(English)https://www.example.com/es/something
(Spanish)
I am trying to figure out the correct hreflang tags for these pages. None of Google’s examples seem to explain how to handle it when you have 2 pages for the language. One is just the canonical.
If I do this, ahrefs tells me I have an error because there are 2 pages for "en":
<link rel="alternate" hreflang="en" href="https://www.example.com/something" />
<link rel="alternate" hreflang="en" href="https://www.example.com/en/something" />
<link rel="alternate" hreflang="es" href="https://www.example.com/es/something" />
Google actually discourages using canonical tags along with hreflang tags. https://developers.google.com/search/blog/2011/12/new-markup-for-multilingual-content
Is the correct solution to simply not have the "/en" version?
2
Answers
You don’t need the /en/something page because you already have the main English domain with hreflang="en". You would have double and identical pages without a utility, even setting canonical tags.
The important thing is that each language has its correct hreflang.
In this scenario, you can add a self-referencing hreflang tag for the default language version. This helps Google bots to identify which is the default version of the page. You can use the x-default html attribute for the default language page.:
In the following example, "https://www.example.com/default-page" is the default language page, and there are alternate versions in Spanish and French.
Example :