What is hreflang? It’s not a new dresser from IKEA or a German candy. It’s a useful piece of code for your website. And if your users speak different languages, using hreflang correctly is critical.
If your site contains content in multiple languages, or in multiple regional versions of the same language (say, American English and British English), hreflang is your friend. Perhaps you have heard of hreflang but don’t understand how it works or why you should use it.
Below are some tips for how to implement hreflang yourself. However, if you are working with a developer, you will want to check whether he or she is using hreflang, and using it in the way that’s best for your business.
Why to Use It
As Yoast describes it, “hreflang is code, which you use to specify all the different URLs on your site(s) that have the same content. These URLs can have the same content in a different language, or the same language but targeted at a different region.” The code itself looks like this: <link rel=”alternate” href=”http://example.com” hreflang=”en-us” />
If you do have multiple languages or dialects on your site, you want to guide users to the page that is best for them. Offering the best result makes for happier users and fewer bounces.
There’s another reason to use hreflang. Google penalizes duplicate content. Two pages with the same content, optimized for different regions may appear the same to Google. Using hreflang eliminates this problem.
When a user conducts a search, the search engine will find all potential pages on your site that meet the criteria. It will then rank the page must suited to the user, based on the user’s location and browser language settings.
How to use it
You can specify just the language or the language and the region. For example “en” would tag content as English, would “en-us” would tag it for the United States and “en-gb” would tag it for Great Britain. Using the country code without the region will ensure that you capture speakers of that language in areas you may not have considered.
This list contains the two-letter codes you will need. Take care to use the right code. Yoast urges, “Google can deal with some of the common mistakes with region codes, although you shouldn’t take any chances.”
Each url should link to each of the others of the same content, as well as to itself. These measures are required for everything to work correctly.
Google introduced hreflang in 2011. Moz points out, “Note that while Google and Yandex currently use the hreflang attribute, Bing uses language meta tags instead.”
Where to use it
You can implement hreflang in the <head>, by using HTTP headers, or in an XML sitemap. Use only one of these three locations. A lot of extra code can slow page loading, so the first two options may be out if you have a lot of pages to tag.
Yoast recommends the XML method, saying, “The benefit of an XML sitemap implementation is simple: your normal users won’t be bothered with this markup. This has the benefit of not adding extra page weight and it doesn’t require a lot of database calls on page load to generate this markup.”
Moz summarizes, “Hreflang attributes may not help you increase traffic; instead, the goal of using them is to serve the right content to the right users.” As a content provider, you want to provide the best experience possible for your user, in hope that they will move to the next stage of the sales funnel or convert. Correctly using hreflang tags will help you do that.
IMAGE: Lawrence Monk / CC0 Public Domain