What are Hreflang Tags? 

Hreflang tags, also referred to as hreflang attributes, are essential for individuals who own multilingual or international sites. They are tags to tell Google and other search engines that you have a multilingual website and to show the users who speak other languages or who are from a different part of the world the proper version of your website. 

The tags are typically contained in your HTML code that will let a search engine, like Google, know which version of a page to show a user in a certain country or with a certain browser language set. This means search engines will use the hreflang tags as guides to give the correct language URL in the search engine results page (SERPs) depending on the searcher. 

Anyone interested in building their SEO presence internationally and would like to target individuals from different countries should have extensive knowledge or someone at their disposal that knows of hreflang tags and know how to properly set them up.

Hreflang Code Sample

<link rel=”alternate” href=”http://lseo.com” hreflang=”en-us” />

Hreflang-Tags Format

Formatting hreflang tags is important because if you don’t have them set up correctly, search engines will ignore them. Typically all hreflang tags carry the same format, the only thing that will change is the URL and the language/country code contained in each tag. 

The regular format of an hreflang tag is usually the language code and then the country code separated by a dash. For instance, “en-au” targets English-speaking Australians. Alternatively, your hreflang tag can specify the language without necessarily mentioning a region. For instance, “en” targets everyone who speaks English worldwide.

When writing the language code in tags, it is worth mentioning that it has to follow the ISO 639-1 two-letter code style. For instance, zh (Chinese), es (Spanish), and en (English). 

When writing country codes, you ought to follow the ISO 3166-1 Alpha 2 format. For instance, sg (Singapore), us (United States), and au (Australia). 

You do not need to use a country code if the page is being translated in the same country. Note that the language tag must come before the country code whenever you write an hreflang tag.

You can implement hreflang tags in three ways.

Elements of Hreflang Tags

An hreflang attribute has three parts, rel= “alternate”, “href”, and “language/country tag.

”rel= “alternate”

lets the search engine know that a similar, alternate version of a webpage exists.


is the link of the main or alternate page. It usually represents the location of the specific page.


The(language and country code) highlights the given page’s language and country. You have to use the country and language codes to specify what web pages should be shown to users within a certain country or who speak a certain language.

The main purpose of the hreflang tag is to indicate where content is located and how it should be rendered according to language, region and/or access. This tag has helped many companies expand their global reach by increasing the number of languages they support, as well as improving the relevance of content for each user’s specific needs.

ISO region and Language Codes

It is worth noting that you are limited to a specific country when you are targeting a specific region, so you cannot generalize your code. Otherwise, your efforts will be ineffective. There is a specific code for each region and language. That is why you need to use the ISO codes as your guide. ISO 31666-1 Alpha 2 for a specific region and ISO 638-1 for a specific language code.

You can view a list of the codes on the ISO browsing platform

search country and language codes for hreflang

Please do not use the standard abbreviations you are used to since most codes are not as intuitive as individuals assume. For instance, the standard abbreviation for the United Kingdom is “UK.” However, if you are writing it as hreflang tag using the ISO as your guide, the appropriate abbreviation is “gb.”

Therefore, ensure you double-check to confirm you are using the proper abbreviation before using the wrong code throughout your site. Note that using the wrong code means your target will not see the content when searching for it.

Luckily, hreflang tags do not limit you. You can use multiple tags on a single page to show the page to users in different countries. For instance, you can target Chinese speakers in Australia, UK, and the US. Remember to add the overall hreflang tag without the region code so that other individuals who speak Chinese in other areas of the world can still find your website. This also ensures that the website traffic you need is not limited to specific regions.

Where the Hreflang Tags are Placed

As discussed earlier, it is essential to know where the hreflang tag should be placed, and you should be very careful when doing this. A slight mistake can affect your overall work, meaning you will have wasted a lot of your time and effort. That is why we recommend using the various tools available.

Your hreflang tag can be placed in three places, the header of your HTML code, in your XML sitemap, or the HTTP header depending on the site’s setup. You can only use one of the named locations. Note that there are different tools, so you need to consider that when choosing a tool. Make sure you use a tool if you use the sitemap option since it is more complex and long.

Hreflang Tags in the HTML Header

The most common method for deploying hreflang tags in the header of a website’s HTML source code. 

Each page should be associated with its own set of hreflang tags as the tags will change based on the URL of the page.

It is important to note that hreflang tags should not be placed in the head section of a page but instead in the PAGE’S HTML header. Placing them in the head section can cause errors and problems when loading pages with an international focus, as well as reduce their effectiveness by up to 50%. Placing them in the website’s header will make them uniform across the site, and as was said, the tags will change based on URLs.

Hreflang & XML Sitemaps

You can also implement hreflang tags on your website using your xml sitemap. You have to include variant URLs when serving the tag within a sitemap for every language that is available. However, there is no need to add hreflang tags for separate accelerated mobile pages (AMP) if you have them. Apply the tag on your website’s primary pages only. 

This is a less common method for deploying hreflangs than putting them directly in the source code. We prefer the source code method when possible. 

Hreflangs for PDF Documents & Non-HTML Files

If you publish pdf and non-html files on your website, you will have to use HTTP headers to implement hreflang. This is usually set in the site’s backend. 

If you would like to identify a PDF document on your website in Spanish or Chinese, it will appear like this: https//zh.example.com/document.pdf;rel=“alternate”;hreflang=“zh”



The downside of using HTTP headers is it can slow down the browsing experience since it adds many overheads to every request someone makes on your website.

Organic Rankings

It is worth noting that using hreflang tags does not have a direct impact on rankings and generating traffic to your website. 

Using hreflang tags simply ensures that a user is served the content they are looking for. They make it easier for search engines to give the appropriate version of the information into the search engine results page, depending on the user’s language preference and location. ccTLDs are what essentially help with ranking when targeting specific locations.

SEO still needs to be performed on each version of your website that you have. 

SEO & Hreflang Tags

Once you have had a good grasp of what hreflang tags are and how to use them, you ought to know how to maximize them in SEO. Just because you have a tag targeting a specific language or country doesn’t mean you will be awarded a page 1 Google result for specific users. 

If you intend for your page to rank highly, you need to have an SEO strategy to help you achieve this. Remember that you cannot use the same strategy across your entire international audience. After all, how others speak and the meaning of words change across different audiences.

When optimizing your SEO for a global audience, the process is more technical since everything has to be optimized, starting with the structure of your URLs, the on-page content, and even meta titles and meta descriptions. You will need to optimize your content for different languages and the specific regions you are targeting.

When ranking international versions of your website, there are specific factors that search engines consider. Listed below are a couple of the most common factors they consider.

  1. Local links from specific domains in a country (ccTLDs).
  2. Optimized URLs for a specific region and language.
  3. Contact information on GMB pages and international directories.
  4. Content that is optimized for a specific region and language.

If you have knowledge of SEO best practices or work with an SEO company, then you should be fine here. The main problems individuals have when working on international SEO and applying is improperly applying the hreflang tag, but also adapting to the language of the different targeted audiences. 

As discussed earlier, applying these tags is not that easy. The process of implementing tags can be long and complex as it’s most likely across many pages of your site, so when you are applying them to your URLs, a simple oversight can ruin all your effort.

Remember that without the hreflang tag to call the alternate version, search engines could assume that your content is duplicated, which negatively affects the UX of users in a particular region. It could even result in users being served the completely wrong version of your website. 

Listed below are SEO best practices.

Stick to the SEO Basics

When it comes to international SEO, it is best to keep things simple. It is important to make sure that there are no duplicate content mistakes within the on-page content and that the title tags are in the appropriate language targeting the correct keywords or phrases in that language.

This helps the company attract more traffic from potential customers in other countries. However, a site should not sacrifice the quality of its content for international SEO purposes. This is why it is important to make sure that translations are accurate and provide a good representation of what it actually means instead of just translating word for word from one language to another.

Aside from the on-site translations, technical SEO and off-site strategies can’t be ignored. Each version of your website and it’s pages, whether it’s on a ccTLD or within a subdirectory, should be optimized from a technical SEO standpoint to ensure a great UX across all users. Likewise, an off-site strategy should be put in place to acquire backlinks from websites within the region you are targeting with your alternate versions.

Organize Your Website Structure

For SEO best practices, it would make a significant difference if you organized your website structure either for region-specific or language-specific webpages. There are three approaches you can take when doing this.

  1. Organizing linguistic or regional content by subdomains, for instance, sg.example.com.
  2. Organizing linguistic or regional content by subdirectories, for instance, example.com/sg/
  3. Optimizing your website around ccTLDs, for instance, example.com.sg.

Traditionally, ccTLDs were the best option for international companies marketed to individuals in a specific region or language. ccTLDs can be confusing and are expensive. It is worth mentioning that applying hreflang tags can clear up search engines’ regional and language differences. However, there is still a possibility of duplicate content issues popping up.

On the other hand, subdomains will target users by region and language, but it is considered a new domain, so you will have to build your SEO signals from the ground up. 

Subdirectories are a bit easier to work with, but there is still a chance that you may have the wrong content being shown to users in separate regions and things could get messy.

All in all, any of the structures will work if you get it right! However, if you can pull off the ccTLD, that would be the way to go.

Generating Hreflang Tags with Tools

Implementing hreflang tags can seem like a daunting and hard task, but it is not. When doing it manually, it’s easier to make a mistake, so you need an hreflang checker or a generator tool that will generate the tags for you properly. Luckily, there are multiple tools that you can select from if you would like to implement the tag on your website.

hreflang tag generator tool

Once generated, you will just need to know how to place them within your source code based on your website platform and backend setup. 

You can run a simple Google search to find more hreflang tools that may better fit your need or hire a technical SEO company to help you generate and place the tags. 

Get Your International Targeting Right!

If you’ve been struggling with your international SEO, Hreflang Tags may be the solution. LSEO is a complete digital marketing agency that can help you create an effective global SEO strategy for any business or product by leveraging this relatively new tech tool. By implementing these simple tags on your website and in your content, we can ensure Google understands which language version of each page should rank in search results. We would love to talk with you more about how we could work together to improve your online presence! Fill out our contact form below so one of our experts from LSEO can follow up soon!