Our latest news & views
When we’re talking about SEO of translated websites, the term ‘hreflang’ is used on a regular basis. Many people know it’s something they should use, but don’t know why or what exactly hreflang is, let alone how to say it. It is pronounced H-ref-lang by the way!
For those of you who want to know more about this strange-sounding term, we’ve put together a list of questions and answers that will hopefully provide you with an understanding of what hreflang is and why you need it.
hreflang is a tag that you can use to specify the target audience of your web pages through either their language or their country. It not only serves to help stop search engines seeing the different versions of your websites as duplicates, but also points people to the language version of your website that would be most suitable for them.
For example, if a German speaking customer was searching for your website, Google would put your German page in their search results, rather than just showing them the English one.
hreflang tags are used by search engines to see what country your page is intended for and which language it is written in. It can also provide alternatives of the same page, but for other countries and languages, and specify a default country and language. hreflang is one of the ways that you can ensure that your target audience in a particular country get to see the most relevant version of your website when they search for it.
For example, hreflang can be used to target and differentiate between different countries who use the same language, like the USA and Australia.
<link” rel=”alternate”hreflang=”fr-SC” href=”https://www.example.com/sc/” />
The first bit rel=“alternate” is the bit that tells Google that these pages are actually just different versions of the same page.
The first two letters after the ‘=‘ are the language and the second two are the country. So in our example, the country would be the Seychelles and the language would be French.
The URL tells google which page we want our hreflang tag to apply to. In our example, it’s our page for the Seychelles.
If you’ve gone to the trouble of localising your web page for a particular country, you want your potential customers to land on it when they conduct a search. By giving your target audience information that is relevant to them, you’ll get fewer bounce backs to the search engine and therefore a higher ranking.
Also, as we briefly mentioned earlier, it helps to ensure that Google doesn’t see your localised pages as duplicates (like your American and Australian pages), which could cause your search engine ranking to fall.
If you have localised your web pages and have either the same content (in the same language) aimed at different countries, or you have the same content in different languages, then you should consider using hreflang.
Sometimes, it’s best to use a hreflang tag that just specifies the language and not a country. For example:
What would come up to someone searching for your website in French in the UK? For this reason, it’s best to have the ‘fr-FR’ version as just ‘fr’, so that only the language is specified and anyone searching in French outside of the Seychelles and Belgium will get that site.
It’s also important to remember to use the right codes for every country and language, using the 2 letter ISO 639-1 format for the language and ISO 3166-1 Alpha 2 for the region.
One mistake many people make is to use “en-UK” for people who speak English in the UK – whereas actually the correct code is “en-GB”.
It’s worth noting that while you can specify only a language, you can’t specify a country code by itself.
It’s essential that every URL has return links to every other URL, as per these instructions from Google:
“Missing return links: annotations must be confirmed from the pages they are pointing to. If page A links to page B, page B must link back to page A, otherwise the annotations may not be interpreted correctly.”
Your hreflang tag must also refer back to itself.
You can implement hreflang in one of three ways: by using HTTP headers, an XML sitemap or a HTML link element in the header. These methods each have their own set of pros and cons, so it’s important to research what would be right for your website and choose the method that best suits your purposes.
When implementing hreflang, it’s a good idea to also add a value known as x-default. This tells search engines where someone who’s searching for your website should be sent if their browser settings don’t match your other hreflang languages.
For example, if a user was searching in German and you didn’t have a German website, it would direct them to your default website. Using an example we mentioned previously:
The German customer would be sent to your french language (fr) website.
It’s worth noting here that hreflang tags and rel=“canonical” tags should be used together – but this is a whole other article!
Making sure that your hreflang is working correctly by having a regular audit of your hreflang implementation is always a good idea. You’ll also need to make sure that your hreflang is still working every time you make any changes to your website, by ensuring that your hreflang is updated to reflect these changes.