International websites can have several versions of the same page for different countries or languages. If these versions aren’t properly identified, users may see a page not meant for their market. This is where the question of where to put hreflang tags becomes important for businesses managing international websites.
Hreflang helps search engines understand which version of a page is intended for a particular language or region. It is useful when you create similar pages for different audiences, such as Australian and US customers.
So, where should hreflang tags be placed? There are three accepted options: the HTML <head>, HTTP headers, and XML sitemaps. This guide explains how each method works, when it may be suitable, the key hreflang SEO practices, and mistakes that can cause problems.
Hreflang is an attribute that tells search engines which language a page is written for and, where relevant, which country it targets. You can use it for a language on its own, such as en, fr, or de, or combine it with a country code, such as en-au, en-us, or fr-ca.
For example, an Australian business may have a service page for English-speaking customers in Australia and another version for customers in the United States. The pages may cover the same service, but prices, spelling, terminology, or availability can differ.
Hreflang is especially useful when pages are similar but made for different audiences. It tells search engines that these pages are related versions of each other, rather than treating each URL as a separate page.
A hreflang implementation can be declared in an HTML page’s <head>, through an HTTP header for non-HTML files, or within an XML sitemap. Each alternate should reference the relevant versions, including itself.
There are three accepted locations for hreflang implementation: the HTML <head>, HTTP headers, and XML sitemaps. The best method depends on the site’s setup and content type.
The HTML <head> is a practical option for standard web pages and small-to-medium multilingual websites. The hreflang links should be placed inside the <head> section, not in the visible body content.
For example:
<link rel=”alternate” hreflang=”en-au” href=”https://www.example.com/au/” />
<link rel=”alternate” hreflang=”en-us” href=”https://www.example.com/us/” />
<link rel=”alternate” hreflang=”x-default” href=”https://www.example.com/” />
Each language or regional version should contain the same set of alternate references, including a self-referencing hreflang annotation. This keeps the relationship between the equivalent pages clear.
For a smaller website, this approach can be easy to implement through page templates. However, managing many alternate links directly in HTML becomes harder as countries and URLs grow.
HTTP headers are best suited to files without an HTML <head>, such as PDFs. The hreflang annotation is delivered through the HTTP response header rather than being added to the document itself.
For example:
Link: <https://www.example.com/guide-fr.pdf>; rel=”alternate”; hreflang=”fr”
This works well when a business has downloadable resources in more than one language. For regular HTML pages, though, HTTP headers are usually not the first option. Adding the tags to the page or sitemap is generally simpler to manage.
An XML sitemap can be a practical option for larger websites with many language or country variations. Instead of adding hreflang annotations to every page’s HTML, the sitemap centralises the information and uses xhtml:link annotations to describe the alternate URLs.
This can be useful for ecommerce websites, franchises, SaaS platforms, and enterprise sites with thousands of URLs. A large product catalogue, for example, may have Australian, US, UK and Canadian versions of many product pages.
Centralising the information can make large implementations easier to manage. The sitemap still needs to stay accurate when pages are removed, redirected or replaced.
The best placement depends mainly on the website’s size, content type and technical setup. All three methods are accepted, so businesses should choose the one they can maintain accurately.
| Website situation | Best placement |
| A small multilingual website with standard pages | HTML <head> |
| PDFs or other non-HTML documents | HTTP headers |
| A large website with many international URLs | XML sitemap |
| A site with limited development capacity per page | XML sitemap |
For most business websites, HTML <head> implementation is the most straightforward option when the site has a manageable number of localised pages. For a large site, XML sitemap management may be more scalable because you can maintain alternate relationships centrally.
Sign up for our newsletter and be the first one to know about our exclusive offers, digital marketing news and updates.
|
|
Thank you for Signing Up |
HTTP headers are generally better for non-HTML resources than for standard web pages. You don’t need to use different methods unless there is a specific technical reason. Keeping one consistent method also makes it easier to check and fix hreflang issues later.
Correct placement is only one part of a reliable hreflang setup. Codes, URLs, and page relationships must also be accurate.
Use standard language codes such as en, es, or de. Add a country code when the content is specifically adapted for that country, such as en-au or en-gb.
Avoid creating codes for cities, such as en-sydney. Hreflang supports recognised language and country codes, not individual cities or regions.
Each version should identify itself and its alternate versions. If a page has Australian, US and UK versions, each version should include the relevant alternate URLs and its own URL.
This creates a complete relationship between equivalent pages and reduces the risk of an incomplete setup.
Use the full URL, including https://, instead of a relative path. For example, use https://www.example.com/au/page/ rather than /au/page/. This makes it clear which URL the hreflang tag is pointing to.
x-default can serve as a fallback for visitors whose language or region doesn’t match the listed alternatives. It is often useful for a language selector, global homepage, or broadly relevant version.
Each language or regional page should generally use a self-referencing canonical URL when it is intended to appear independently in search. Do not canonicalise all translated or localised pages to one master version, as this can conflict with the purpose of having separate regional pages.
Hreflang issues can happen because of simple implementation mistakes. Even when the tags look correct, problems can still occur if the referenced URLs are wrong or the alternate pages aren’t linked properly. Some of the common mistakes are:
It is also worth checking that every alternate page remains live and that changes to URL structures are reflected in the hreflang setup. These checks matter as international websites grow and regional pages change.
A technical SEO professional can audit these signals alongside crawl issues, canonicalisation, indexability, and sitemaps. This broader check matters because a correctly written hreflang tag cannot fix problems with the URLs it references.
Clickmatix is a Sydney-based digital marketing team that supports businesses with technical and international SEO. As websites expand into new countries, keeping localised URLs, canonicals, sitemaps, and hreflang references aligned becomes harder.
Our services can include international SEO audits, hreflang implementation reviews, XML sitemap optimisation, canonical and indexing checks, and localised content strategy. These checks identify broken references, inconsistent regional signals, and technical issues.
For businesses looking for an SEO agency Sydney companies can turn to, Clickmatix can review the technical structure behind international visibility. An SEO specialist can also assess whether the site’s regional pages and supporting signals are working together as intended.
The focus is on helping users reach the right locally targeted pages and supporting visibility in international searches.
Hreflang tags can be included in the HTML <head> sections, in HTTP headers, or in XML sitemaps. The best choice will vary according to the type of content, the size of the website, and maintenance requirements.
For standard pages, the HTML <head> section is usually the simplest option. HTTP headers are well-suited for non-HTML files, whereas XML sitemaps work better when dealing with large international websites. It is also important to have reciprocal references, valid codes, self-referencing tags and compatible canonicals.
Do you need help managing a multilingual or multi-region website? Speak with Clickmatix on 1300 159 314 for practical technical and international SEO support.
Let us understand your business thoroughly and help you
strategies your digital product.
It's time to call your business-
a brand!
Australian Owned Agency
Save Time and Money
Unbeatable Value
Where Work Gets Done
It's time to call your business-
a brand!
Australian Owned Agency
Save Time and Money
Unbeatable Value
Where Work Gets Done
With this Ecommerce SEO Guide, you'll be able to:
With this Youtube ads Guide, you'll be able to:
It's time to call your business-
a brand!
Australian Owned Agency
Save Time and Money
Unbeatable Value
Where Work Gets Done
