How to use "hreflang tag"?

Use of hreflang tag

HTML link element in header. In the HTML <head> section of Example Domain, add a link element pointing to the Spanish version of that webpage at http://es.example.com/, like this:

<link rel="alternate" hreflang="es" href="http://es.example.com/" />


HTTP header. If you publish non-HTML files (like PDFs), you can use an HTTP header to indicate a different language version of a URL:

Link: <http://es.example.com/>; rel="alternate"; hreflang="es"


To specify multiple hreflang values in a Link HTTP header, separate the values with commas like so:

Link: <http://es.example.com/>; rel="alternate"; hreflang="es",<http://de.example.com/>; rel="alternate"; hreflang="de"


Sitemap. Instead of using markup, you can submit language version information in a Sitemap
 
The hreflang tag on each page should include a reference to itself as well as to all the pages that serve as alternates for it. If your Spanish website sells Iberian ham to customers in Spain, France, and Portugal only, the hreflang tags for your homepage might look like this:

<link rel="alternate" href="example.com" hreflang="es-es" />
<link rel="alternate" href="example.com/fr/" hreflang="fr-fr" />
<link rel="alternate" href="example.com/pt/" hreflang="pt-pt" />
 
Using hreflang like,
<link rel="alternate" href="http://example.com" hreflang="en-us" />
 
Back
Top