Have you ever visited a webpage that was written in another language and your browser asked you if you wanted to change it to your native language?
It’s a lifesaver right?
Now consider whether you have provided the functionality to make your own web pages ready for a global audience. If you haven’t tagged or redirected your content properly to tweak it in different languages, it may not be gaining the traffic it could have.
The name for this attribute is called Language Tagging and is an SEO tag that you can use to ensure search engines know what language your content is in.
There are two different types of language tags: HTML tags and hreflang tags.
While both HTML and Hreflang tags are intended to optimize content in multiple languages, they have some differences.
Put simply, language (or long) tag attributes on an HTML tag tell your browser the language of the current document or website, while the hreflang tag attribute tells your browser the language of the website to be linked – for example a long tag on HubSpot.com tells your browser the language of HubSpot.com, but a hreflang tag attribute tells a search engine the language of HubSpot.com when a user searches for HubSpot.
When a user searches for HubSpot.com from Germany, a hreflang tag is responsible for changing the link available in the search engines. However, when someone lands on HubSpot.com in Germany, a lang tag changes the language on the page itself.
Visualization may be easier. Here is an example of a long day:
Alternatively, here is an example of a hreflang tag:
Google recommends using hreflang when indexing websites in different languages.
Next, let’s examine what hreflang tags are used for and how you can use them on your own web pages.
What are hreflang tags?
With this attribute, a search engine knows which language is used on a website that is linked to a SERP. This enables search engines to deliver language-specific results.
The tag is: rel = “alternative” hreflang = “x”
Hreflang tags allow you to show Google and other search engines the relationship between web pages in different languages. For example, if your tag needs to be linked to an English language blog, use the following tag: hreflang = “en”.
This is an example of what a website will look like when given a hreflang attribute:
The “en” in the first part of the tag refers to the English language code, and the “US” refers to the country code for the United States.
Users with an IP address that notifies which language is being used will automatically see a properly tagged web page. A hreflang tag is therefore especially helpful if you have a global audience and want to make their user experience pleasant.
Why do you need hreflang tags?
Ultimately, it helps to use hfreflang tags for a better user experience. When a user searches for HubSpot in Germany, we want to make sure that the result in the search engine shows our website in German and not in English. In addition to providing a better user experience, it can also help reduce the bounce rate and increase conversion rates as you are showing the best version of your website to the right audience.
How do hreflang tags work?
Let’s look at an example to illustrate how Hreflang works. Suppose you create two homepages that are the same, but one in English (hreflang = “en”) and the other in Spanish (hreflang = “es”).
When a user searches for your home page in Spanish or in a Spanish language browser, they will get the Spanish version of your home page, if it’s properly tagged.
Every language and every country has its own hreflang tag. Here is a list of the most common:
German / Germany: de-de
English / USA: en-us
Irish / Ireland: ga-ie
Hindi / India: Hi-In
Italian / Italy: it-it
Japanese / Japan: ja-jp
Korean / Korea: ko-kp
Portuguese / Brazil: pt-br
Russian / Russian Federation: ru-ru
Chinese (simplified) / China: zh-hans-cn
Thai / Thailand: th-th
If you’re sharing the same page in different regions, be aware that there may be multiple hreflang tags on the same page. For example, if your French website is also being sold to customers in Germany and Spain, you can tag your page accordingly in HTML.
Note that your page may rank higher in another language as hrefleg tags can be overridden by other SEO options. To avoid this, make sure that search engines are equipped with the correct attributes so that they know what language your page should be presented in.
Ultimately, hreflang tags are about providing content that is meant for them to customers who speak different languages or live in different regions of the world. Search engines give international users the version of the page in their language on the results page.
If this is all a little confusing, don’t worry. You can use a free hreflang tag generator. So all you have to do is copy and paste the code. Let’s look at some examples below.
Hreflang Tags Generator Tools
1. The Hreflang Tags Generator Tool
You can use this tool to generate hreflang tags for your multilingual site. All you have to do is add the URL to your website and choose what language it is in.
This is a great tool as you can even upload a CSV with up to 50 URLs and generate the hreflang tag for 50 websites at a time.
2. Geo targeted
Geo Targetly is another great hreflang generator tool. It’s easy and free to use. All you have to do is enter your url and language and then voila.
While you can’t build up to 50 websites at a time, it’s a quick and easy option.
The Sistrix tool is similar to the other two tools mentioned above. All you have to do is enter your url and language and the tool will then generate the code for you.
Now that you know a little more about hreflang tags, let’s talk about HTML language tags.
Example of an HTML language tag
HTML language attributes define the language of a website. For example, an HTML language tag for an English website would look like this:
Remember that Google doesn’t look at HTML language tags, but other search engines may. So it’s a good idea to keep including these for search engines that don’t display hreflang tags.
You may also want to use HTML language tags in conjunction with a hreflang tag. These can work together to inform search engines about the content of your web pages. If both tags are present, search engines will know what language a website is in and users from other countries will be redirected to the corresponding website.
When optimizing your content for search engines, it is important to do everything possible to rank on the SERPs. This helps people all over the world find your business.