You can implement hreflang with link tags in the page head, with HTTP headers or inside an XML sitemap. All three are valid. HTML tags suit small sites, sitemaps suit large ones where editing every page is hard, and HTTP headers are mainly for files such as PDFs. Pick one method and keep it consistent.
Method 1: link tags in the HTML head
Each page lists its alternates in the head. It is simple and visible, which makes it easy to check. The downside is that every version of every page must carry the full list, which grows quickly.
Method 2: HTTP headers
The server sends the annotations in the response header. This is the only practical option for non-HTML files such as PDFs, and it needs server access to set up.
Not sure if this is hurting your site?
Get the fixes that matter most, in priority order.
Method 3: XML sitemap
You list each URL and its alternates in a sitemap file. This keeps annotations in one place, which is easier to maintain on large sites. Learn more about the files in XML sitemap size limits.
Which should you choose?
- Small site with a few versions: HTML tags.
- Large site with many pages and languages: sitemap.
- Non-HTML content: HTTP headers.
Do not mix conflicting sets
If you use more than one method, the annotations must agree. Conflicts cause confusion. Generate a consistent set with the hreflang generator, then check the structure with the sitemap validator.
Check the outcome
Every version must reference all the others, as explained in hreflang return tag errors.
Frequently asked questions
Which is easiest to maintain?
The sitemap method, for sites with many pages.
Does Google prefer one method?
No. All three are supported equally.
Next steps
If you are unsure which method fits your platform, contact me here.
More in this series (hreflang questions): start with Free Hreflang Tag Generator and Checker, then explore:
- Hreflang x-default Explained: What It Is and When to Use It
- Hreflang Return Tag Errors: What They Mean and How to Fix Them
- Hreflang Language and Region Codes: How to Get Them Right
- Hreflang and Canonical Tags: How to Stop Them Conflicting
Request received
Thank you! Saad will contact you within the next 24 hours.
Keep an eye on your phone and inbox.
