Skip to content

International SEO

Hreflang in HTML, HTTP Headers or XML Sitemap: Which Method Should You Use?

Add saadrazaseo.com as a preferred source on Google

No pressure and no sales script. Just honest answers.

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.

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.

Find my blockers

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:

Is this holding your site back?

Share your website and I will look at the technical issues holding it back.

Your details are only used to reply to your request. No spam.

Grow my trafficCall