Hreflang tags are used to tell Google and other search engines that a piece of content is targeted at a specific language or location. For instance, say you have two websites, one a .co.uk targeting the UK and another a .com targeting the USA, but they both have an identical home page. In this scenario, you can use the hreflang to tell Google that the home page for the .co.uk version should target the UK, and the home page for the .com version should target the US.
Not only does this help ensure that the correct content is served to the correct audience (for instance, it will help Google understand that they should not serve the .com homepage to the UK), but it will also help to prevent duplicate content issues.
The main purpose of hreflang tags is to improve the accuracy of search engine results for international or multilingual websites. By implementing hreflang tags correctly, you can:
Target specific countries or regions: Hreflang tags allow you to specify which version of your website should appear in search results for users in different countries or regions.
Display the correct language version: If your website offers content in multiple languages, hreflang tags help search engines identify the appropriate language version to display based on user preferences.
Avoid duplicate content issues: Hreflang tags help prevent search engines from considering similar content in different languages as duplicate, ensuring that each language version is appropriately indexed and displayed.
How to use hreflang tags
To implement hreflang tags correctly:
Identify the language and country/region combinations for your website. For example, if your website has versions in English (United States), English (United Kingdom), and French (France), you’ll need to determine the language and country codes for each version.
Add the hreflang tag in the <head> section of the HTML code for each page. The tag should include the rel="alternate" attribute to indicate an alternative version of the page and the hreflang attribute to specify the language and country/region.
The hreflang tag can be added in different ways depending on your website structure:
On a single-language page: Include the hreflang tag for all available language versions of that page.
On a multilingual page: Include the hreflang tag for all available language versions of that page, pointing to the corresponding versions.
Use the language and country/region codes in the hreflang tag. For language codes, follow the ISO 639-1 standard, and for country/region codes, use the ISO 3166-1 Alpha-2 codes. For example, en-us represents English (United States) and en-gb represents English (United Kingdom).
Here are two coding examples for implementing hreflang tags:
International SEO and the importance of hreflang tags
By implementing hreflang tags correctly, you can ensure that search engines display the appropriate language and regional versions of your website to users in different locations. This improves user experience, increases organic search visibility, and helps drive targeted traffic to the right pages.
Remember to regularly monitor and update your hreflang tags as your website expands or language preferences change. Additionally, combine hreflang tags with other international SEO best practices to achieve optimal results in global search rankings, such as creating localised content, gaining local backlinks and utilising country-specific domains, subfolders or subdirectories.