In international SEO, the `hreflang` attribute is a powerful signal, but its power is entirely dependent on its placement. A common and critical mistake is placing hreflang link tags outside the `<head>` section of an HTML document. Search engine crawlers are programmed to look for this metadata in specific places. If your hreflang tags are in the `<body>`, they are semantically incorrect and will be ignored, rendering your international targeting efforts useless.
Think of your HTML document as a formal report. The `<head>` section is the cover page and table of contents—it provides all the critical metadata for the reader (or crawler) before they dive into the main content. Placing hreflang tags in the `<body>` is like burying a key piece of information in a footnote on the last page; it will almost certainly be missed. For a broader look at international SEO, see our guide on localization.

The Three Valid Homes for Hreflang Signals
According to Google’s official documentation, you have three valid options for implementing hreflang. It is critical to **choose only one** of these methods to avoid conflicting signals.
| Method | Use Case |
|---|---|
| HTML `<head>` Section | The most common method for HTML pages. |
| HTTP Headers | Essential for non-HTML content like PDFs or images. |
| XML Sitemap | The most scalable and recommended method for large websites. |
How to Fix Incorrect Placement
The fix is to move the hreflang link elements from the `<body>` to the `<head>`.
<!-- Before: Incorrectly placed in the body -->
<body>
<link rel="alternate" hreflang="en-gb" href="https://en-gb.example.com/page.html" />
...
</body>
<!-- After: Correctly placed in the head -->
<head>
<link rel="alternate" hreflang="en-gb" href="https://en-gb.example.com/page.html" />
...
</head>
For more on common `hreflang` mistakes, such as hreflang language issues, check out this guide from Moz.
Frequently Asked Questions
Which hreflang implementation method is best for my site?
For most websites, placing hreflang tags directly in the HTML `<head>` is the simplest and most common method. For very large sites with many language variations, an XML sitemap is more efficient and scalable. For non-HTML files like PDFs, HTTP headers are the only option.
Is it okay to use JavaScript to inject hreflang tags into the <head>?
This is a risky practice and should be avoided. Search engines may not render the JavaScript before discovering the hreflang tags, which could cause them to be missed. Hreflang tags should always be present in the initial HTML source code.
If I use an XML sitemap for hreflang, should I also put the tags in the HTML?
No. You should only use one method. Implementing hreflang in both the sitemap and the HTML can lead to conflicting signals and creates significant maintenance challenges. Choose the one method that best fits your site’s scale and stick with it.
Are your hreflang tags in the right place? Use Creeper to audit your hreflang implementation and ensure your signals are being heard.