SEO is the art of speaking your customers’ language so that they find you as easily as possible online. It’s about talking how they talk and understanding what they’re looking for.

But it’s also about technicalities. It’s no use having carefully optimised website copy and locally relevant content if it’s not structured in a way that helps search engines find and deliver it. When you’re working on international SEO, hreflang tag attributes are one of the most important tools you’ve got.

They’re just one of the aspects of international SEO that we can help you to get right – find out more about our explore more international SEO service.

What are hreflang tag attributes?

Put simply, using the hreflang tag attribute tells Google what language is being used on a page – so that the user searching for it is served the version of the page that’s most relevant to them. It also explains the relationship between web pages in different languages, making it clearer to Google that they are versions of the same page so that duplicate content is less likely to appear.

It works by including a clear signal in a page’s header or HTML (or both) that a user speaking a particular language will want to see that version of the page in question. Hreflang tag attributes have been around since Google introduced them in 2011, but they remain a signal rather than a directive – meaning that it’s possible for them to be overridden by other SEO factors, and have less impact on ranking than intended. That’s why understanding how they work – and how to use them effectively – is so critical to a successful international SEO strategy.

Why are hreflang tags important for SEO?

Making sure the right version of a page is served to the right audience will help your business to connect with them, but it also helps to maintain your website’s standing with Google internationally by increasing its local relevance. Hreflang tag attributes can decrease bounce rates, increase dwell times and have a direct impact on your conversion rate.

Not only do hreflang tag attributes ensure relevance for users speaking a specific language, but they ensure that ccTLDs (country-code top-level domains) don’t cancel this out by limiting the page to one country. For example, if a page is in Portugese, it may also be relevant to users in Brazil, and hreflang tags ensure that it appears the same for both.

More specific versions of hreflang tags can be used to further differentiate between both (ie. having a Portugal version and a Brazil version of the Portugese-language page) which is especially useful for variations in things like currency.

What do hreflang tags look like?

Each hreflang tag is structured in a clear and consistent way that’s easy for you – and Google – to understand once you know what each part means:

<link rel=”alternate” hreflang=”x” href=”https://example.com/alternate-page” />

  • The first part (link rel=”alternate”) simply states that the link that follows is an alternate version of the page – this helps ensure Google serves either one version or the other, and doesn’t duplicate content.
  • The second part (hreflang=”x”) explains that the reason for the alternate version of the page is that it’s in a different language. So the “x” is replaced with a specific language code such as “de” for German.
  • The third part (href=“https://example.com/alternate-page”) simply tells Google what the link to the alternate page is.

Understanding ISO language and region codes

While hreflang tag attributes can support a two-letter language code by itself, the language code can be combined with a region code in order to further differentiate between the two. As outlined above, this helps ensure effective targeting of users who might speak the same language in two different countries, so combining language and region codes is seen as best practice in international SEO.

The region code also consists of two letters, but the two should be combined using what’s known as the ISO 3166-1 alpha-2 format. As an example, you might use hreflang=”en-gb” and hreflang=”en-us” to differentiate between English speakers in the UK and America.

It’s important to get the region code right as it can sometimes be counterintuitive (for example, the UK is denoted by “gb” rather than “uk”). It’s worth accessing a list of valid region codes to refer to as while Google can handle common mistakes with region codes and redirect accordingly, this doesn’t always happen.

Where does the hreflang attribute go?

Ensure hreflang tag attributes are used correctly by including them in one of three places:

  • The <head> of your HTML
  • The XML sitemap markup
  • Your HTTP header

The only rule is that you should only put it in one of these places.

Using the XML sitemap markup to implement hreflang tag attributes can help to streamline the process, especially for larger websites where creating duplicate <heads> or HTTP headers can be time-consuming. It also makes it easier to change hreflang tags across a whole site.

However, the need to create self-referencing URLs can mean that putting the hreflang tag in the <head> or the HTTP header can be more efficient if your website doesn’t have lots of pages and lots of alternate versions.

The basics of implementation

Implementing hreflang tags effectively is an essential part of SEO, so knowing what to keep an eye out for and having a checklist in mind can make a big difference to how effective your hreflang tags are.

Having valid hreflang attributes

Get the basic information right within your hreflang tag attribute. Using the language code correctly and combining it with a region code if you need to is one of the key rules of hreflang implementation. If you’re using the wrong region code, or you’ve made a mistake that’s not common enough for Google to see through, you’ll have a number of problems down the line.

Return links

Wherever you put your hreflang tag, every URL you include in one needs to contain return links to every other URL – with no exceptions. If you’ve got a website that’s translated into multiple languages, you need to have hreflang links for as many URLs.

This cements the relationship between different variations of the same page in the eyes of Google and confirms that both versions relate to one another in the same way.

Hreflang link to self

Each page should also have a self-referential hreflang tag which points back to the original version of itself. So for example, you would include the following hreflang tag attributes in both versions of a page:

<link rel=”alternate” hreflang=”fr” href=”https://example.com/contacter” />

<link rel=”alternate” hreflang=”en” href=”https://example.com/contact” />

Different ways to implement hreflang tags

HTML tags

The use of basic HTML tags is often the simplest and fastest way to implement hreflang especially if you’ve not done it before – and it can involve putting multiple URLs into the same tag for different language versions of the same page.

However, if you’re working with a lot of languages or pages it can become a time-consuming and even messy way of implementing that’s difficult to keep track of. This is partly because there’s no limit to the number of HTML hreflang tags you can use on a single page.

HTTP headers

Of course, not every page contains HTML – PDFs being one of the most common examples. You can use the HTTP header of the page instead to specify the language used in different versions of it. You can do this with HTML pages too, but it’s rarely a more efficient way of doing it.

Sitemaps

This can seem like the most complicated way to implement HTML, but while it’s not the quickest, it’s often much more efficient because all the hreflang attributes are defined in a single file and can be changed right across a website without the need to edit HTML heads individually. It also avoids the impact on site speed that having a large amount of extra code in your HTML can cause.

What’s the difference between hreflang and canonicalization?

Canonicalisation (rel=”canonical”) is a tool that performs much the same function as hreflang tag attributes but with limitations – instead of telling Google exactly which version of a URL should show up in a search result, it tells Google which version is the dominant one.

This can avoid issues of content being duplicated but it is not recommended that you use it across different country or language versions of a website as it can lead to the wrong version being shown when alternate versions of a page are very similar.

The effects of hreflang on your rankings

Does the use of hreflang tag attributes affect SERP rankings? It’s hard to say for certain, but while they don’t directly increase traffic to your website, they do help to avoid some of the pitfalls that can have a negative impact on your website’s ranking by ensuring the correct version is served to the correct user.

Fewer people clicking away from your page because they’ve landed on the wrong version of it can improve dwell times and bounce rates and indirectly have a positive effect on your website’s standing with Google and its subsequent ranking.

How to audit your site for hreflang issues

Like many aspects of technical SEO, hreflang tag attributes aren’t just something to be considered when launching a website in a new territory – they need to be continuously monitored for mistakes and issues that can impact user experience and the performance of your site on Google.

For effective ongoing maintenance you can use automated tools such as Ahrefs’ Site Audit to regularly crawl your website and identify any issues, allowing you to solve them as soon as possible before they have any effect.

Common issues and solutions

Here are some of the most common errors that you’re likely to come across when auditing hreflang tags on your website, and how to keep on top of them.

Hreflang annotation invalid

As mentioned above, it’s common for language codes and region codes to be entered incorrectly, and this is the warning that you’ll see when one is. Any invalid hreflang tags will be shown in the “Is valid hreflang” column on the affected page.

Google may ignore any invalid hreflang tags, especially if the mistake that’s been made isn’t a common one – and consequently it might overlook an entire alternate language version of your page. This makes users more likely to be served the wrong version and could impact your site’s ranking in your targeted territories in the long run.

Page referenced for more than one language

A piece of content on your website can only serve one language, or one language and region, at a time, as specified in the codes that you include. So if the URL included in your hreflang tag doesn’t match the language code, for example, this will send mixed messages to Google which is then more likely to overlook the hreflang tag attribute altogether.

To fix this, you’ll need to manually inspect the URLs that are included in each of your hreflang tags.

Missing a return-tag

A return-tag, or a reciprocal hreflang, only works if it’s applied both ways. So if one version of a page links to the other, but that version doesn’t link back, the first link is rendered invalid.

You’ll need to add bidirectional hreflang tags to any affected pages, and one of the ways that you can check for these is via the Language tab on the International Targeting Report in Google Search Console.

Leading to a broken page

Broken URLs are as much a problem with hreflangs as they are with other elements of your website. Quite simply, if an hreflang attribute points to an out-of-date URL, the entire hreflang will be overlooked by Google.

This means if you’re updating your international SEO strategy it’s especially important to make sure that any affected pages are manually updated.

Your international SEO agency

Hreflang tag attributes are a simple enough idea – you’re just ensuring that Google knows there are different versions of your page, and that it sends users to the right one.

But there are a number of common mistakes that can undermine your efforts to cater to different languages – and the interconnected nature of hreflang tag attributes can mean that this has a knock-on effect on all your pages’ rankings in the long term.

Having an international SEO agency at hand when you’re expanding abroad can mean that many of these common errors are avoided – both at launch and afterwards – leaving you to focus on creating the most globally appealing brand possible.

More topics

Digital PR

How to become a digital marketing professional

Read more

SEO

How best to use schema markup to optimise SERPs

Read more

SEO

An expert guide to advanced technical SEO

Read more

SEO

Common technical SEO issues and how to solve them

Read more

SEO

What are orphan pages in SEO? Everything you need to know

Read more

SEO

Technical

Read more

Content

How to write landing page copy: 8 Expert Tips

Read more

Content

What is e-commerce copywriting?

Read more

Digital PR

Link building: How to measure link building success and ROI

Read more

Digital PR

How to write a press release for link building

Read more

SEO

A guide to migrating your site to a different CMS

Read more

Content

Blog Ideas: How to Develop Great Content for Blogs

Read more

Content

Content Strategy: How to Create a Blog Content Strategy

Read more

Content

Blog Content Strategy

Read more

Content

How to write great website copy: a guide from the experts

Read more

Digital PR

How to create a link building campaign

Read more

Digital PR

How does link building help your SEO performance

Read more

Digital PR

Link Building

Read more

Content

Content marketing for small businesses: Our top tips

Read more

Content

Content marketing for SaaS: A Guide

Read more

Content

What is content marketing and why is it important?

Read more

Content

SEO copywriting best practices

Read more

Content

Copywriting

Read more
computer

Digital PR

What Is Digital PR? 

Read more

Digital PR

Digital PR vs. Traditional PR: What’s the difference?

Read more

SEO

A guide to conducting effective keyword research for your website

Read more

SEO

Should you target low search volume keywords?

Read more

Digital PR

What Is Thought Leadership & Why Is It Important In PR?

Read more

Digital PR

Thought Leadership

Read more

SEO

International

Read more

SEO

SEO migration checklist: 11 steps to avoid traffic drops

Read more

SEO

Our guide to URL redirect mapping

Read more

SEO

Website domain migrations: everything you need to know

Read more

SEO

Website Migration

Read more

SEO

On-page SEO

Read more

Digital PR

Fundamentals

Read more

Want cutting-edge digital news and tips straight to your inbox?
Sign up to our monthly newsletter here

"*" indicates required fields

*