What’s technical SEO? 8 technical aspects everyone should know

An SEO Basics post about technical SEO might seem like a contradiction in terms. Nevertheless, some basic knowledge about the more technical side of SEO can mean the difference between a high ranking site and a site that doesn’t rank at all. Technical SEO isn’t easy, but here we’ll explain – in layman’s language – which aspects you should (ask your developer to) pay attention to when working on the technical foundation of your website.

What is technical SEO?

Technical SEO refers to improving the technical aspects of a website in order to increase the ranking of its pages in the search engines. Making a website faster, easier to crawl and understandable for search engines are the pillars of technical optimization. Technical SEO is part of on-page SEO, which focuses on improving elements on your website to get higher rankings. It’s the opposite of off-page SEO, which is about generating exposure for a website through other channels.

Why should you optimize your site technically?

Google and other search engines want to present their users with the best possible results for their query. Therefore, Google’s robots crawl and evaluate web pages on a multitude of factors. Some factors are based on the user’s experience, like how fast a page loads. Other factors help search engine robots grasp what your pages are about. This is what, amongst others, structured data does. So, by improving technical aspects you help search engines crawl and understand your site. If you do this well, you might be rewarded with higher rankings or even rich results.

It also works the other way around: if you make serious technical mistakes on your site, they can cost you. You wouldn’t be the first to block search engines entirely from crawling your site by accidentally adding a trailing slash in the wrong place in your robots.txt file.

But it’s a misconception you should focus on technical details of a website just to please search engines. A website should work well – be fast, clear and easy to use – for your users in the first place. Fortunately, creating a strong technical foundation often coincides with a better experience for both users and search engines.

What are the characteristics of a technically optimized website?

A technically sound website is fast for users and easy to crawl for search engine robots. A proper technical setup helps search engines to understand what a site is about and it prevents confusion caused by, for instance, duplicate content. Moreover, it doesn’t send visitors, nor search engines, into dead-end streets by non-working links. Here, we’ll shortly go into some important characteristics of a technically optimized website.

1. It’s fast

Nowadays, web pages need to load fast. People are impatient and don’t want to wait for a page to open. In 2016 already, research showed that 53% of mobile website visitors will leave if a webpage doesn’t open within three seconds. So if your website is slow, people get frustrated and move on to another website, and you’ll miss out on all that traffic.

Google knows slow web pages offer a less than optimal experience. Therefore they prefer web pages that load faster. So, a slow web page also ends up further down the search results than its faster equivalent, resulting in even less traffic.

Wondering if your website is fast enough? Read how to easily test your site speed. Most tests will also give you pointers on what to improve. We’ll guide you through common site speed optimization tips here.

2. It’s crawlable for search engines

Search engines use robots to crawl or spider your website. The robots follow links to discover content on your site. A great internal linking structure will make sure that they’ll understand what the most important content on your site is.

But there are more ways to guide robots. You can, for instance, block them from crawling certain content if you don’t want them to go there. You can also let them crawl a page, but tell them not to show this page in the search results or not to follow the links on that page.

Robots.txt file

You can give robots directions on your site by using the robots.txt file. It’s a powerful tool, which should be handled carefully. As we mentioned in the beginning, a small mistake might prevent robots from crawling (important parts of) your site. Sometimes, people unintentionally block their site’s CSS and JS files in the robot.txt file. These files contain code that tells browsers what your site should look like and how it works. If those files are blocked, search engines can’t find out if your site works properly.

All in all, we recommend to really dive into robots.txt if you want to learn how it works. Or, perhaps even better, let a developer handle it for you!

The meta robots tag

The robots meta tag is a piece of code that you won’t see on the page as a visitor. It’s in the source code in the so-called head section of a page. Robots read this section when finding a page. In it, they’ll find information about what they’ll find on the page or what they need to do with it.

If you want search engine robots to crawl a page, but to keep it out of the search results for some reason, you can tell them with the robots meta tag. With the robots meta tag, you can also instruct them to crawl a page, but not to follow the links on the page. With Yoast SEO it’s easy to noindex or nofollow a post or page. Learn for which pages you’d want to do that.

Read more: https://yoast.com/what-is-crawlability/

3. It doesn’t have (many) dead links

We’ve discussed that slow websites are frustrating. What might be even more annoying for visitors than a slow page, is landing on a page that doesn’t exist at all. If a link leads to a non-existing page on your site, people will encounter a 404 error page. There goes your carefully crafted user experience!

What’s more, search engines don’t like to find these error pages either. And, they tend to find even more dead links than visitors encounter because they follow every link they bump into, even if it’s hidden.

Unfortunately, most sites have (at least) some dead links, because a website is a continuous work in progress: people make things and break things. Fortunately, there are tools that can help you retrieve dead links on your site. Read about those tools and how to solve 404 errors.

To prevent unnecessary dead links, you should always redirect the URL of a page when you delete it or move it. Ideally, you’d redirect it to a page that replaces the old page. With Yoast SEO Premium, you can easily make redirects yourself. No need for a developer!

Read more: https://yoast.com/what-is-a-redirect/

4. It doesn’t confuse search engines with duplicate content

If you have the same content on multiple pages of your site – or even on other sites – search engines might get confused. Because, if these pages show the same content, which one should they rank highest? As a result, they might rank all pages with the same content lower.

Unfortunately, you might have a duplicate content issue without even knowing it. Because of technical reasons, different URLs can show the same content. For a visitor, this doesn’t make any difference, but for a search engine it does; it’ll see the same content on a different URL.

Luckily, there’s a technical solution to this issue. With the so-called, canonical link element you can indicate what the original page – or the page you’d like to rank in the search engines – is. In Yoast SEO you can easily set a canonical URL for a page. And, to make it easy for you, Yoast SEO adds self-referencing canonical links to all your pages. This will help prevent duplicate content issues that you’d might not even be aware of.

5. It’s secure

A technically optimized website is a secure website. Making your website safe for users to guarantee their privacy is a basic requirement nowadays. There are many things you can do to make your (WordPress) website secure, and one of the most crucial things is implementing HTTPS.

HTTPS makes sure that no-one can intercept the data that’s sent over between the browser and the site. So, for instance, if people log in to your site, their credentials are safe. You’ll need a so-called SSL certificate to implement HTTPS on your site. Google acknowledges the importance of security and therefore made HTTPS a ranking signal: secure websites rank higher than unsafe equivalents.

You can easily check if your website is HTTPS in most browsers. On the left hand side of the search bar of your browser, you’ll see a lock if it’s safe. If you see the words “not secure” you (or your developer) have some work to do!

Read more: SEO Basics: What is HTTPS?

6. Plus: it has structured data

Structured data helps search engines understand your website, content or even your business better. With structured data you can tell search engines, what kind of product you sell or which recipes you have on your site. Plus, it will give you the opportunity to provide all kinds of details about those products or recipes.

Because there’s a fixed format (described on Schema.org) in which you should provide this information, search engines can easily find and understand it. It helps them to place your content in a bigger picture. Here, you can read a story about how it works and how Yoast SEO helps you with that.

Implementing structured data can bring you more than just a better understanding by search engines. It also makes your content eligible for rich results; those shiny results with stars or details that stand out in the search results.

7. Plus: It has an XML sitemap

Simply put, an XML sitemap is a list of all pages of your site. It serves as a roadmap for search engines on your site. With it, you’ll make sure search engines won’t miss any important content on your site. The XML sitemap is often categorized in posts, pages, tags or other custom post types and includes the number of images and the last modified date for every page.

Ideally, a website doesn’t need an XML sitemap. If it has an internal linking structure which connects all content nicely, robots won’t need it. However, not all sites have a great structure, and having an XML sitemap won’t do any harm. So we’d always advise having an XML site map on your site.

8. Plus: International websites use hreflang

If your site targets more than one country or countries where the same language is spoken, search engines need a little help to understand which countries or language you’re trying to reach. If you help them, they can show people the right website for their area in the search results.

Hreflang tags help you do just that. You can define for a page which country and language it is meant for. This also solves a possible duplicate content problem: even if your US and UK site show the same content, Google will know it’s written for a different region.

Optimizing international websites is quite a specialism. If you’d like to learn how to make your international sites rank, we’d advise taking a look at our Multilingual SEO training.

Want to learn more about this?

So this is technical SEO in a nutshell. It’s quite a lot already, while we’ve only scratched the surface here. There’s so much more to tell about the technical side of SEO! If you want to take a deep-dive into technical SEO, we’d advise our Technical SEO training or Structured data training. With these courses, you’ll learn how to create a solid technical foundation for your own website.

PS You’re the ambitious type? Get both training courses together and save $59!

Read more: https://yoast.com/wordpress-seo/

The post What’s technical SEO? 8 technical aspects everyone should know appeared first on Yoast.

Ask Yoast: Publishing in another language and SEO

If you’re creating content for a website, you might want to, occasionally, publish an article in a language different from the language of your other content. However, it’s difficult to rank with one specific article that’s written in a language that differs from the rest. So what should you do to improve the SEO of that article? In this Ask Yoast, I’ll help you out and explain when to optimize your metadata in another language, when to use hreflang and what more to do to help that article rank!

Justin from VPNgids.nl (VPNguide.nl) emailed us with this question:

“I’ve got a Dutch blog but I want to publish an article in English. What should I do? Should I just add an hreflang tag or something else?”

Check out the video or read the answer below!

Become a technical SEO expert with our Technical SEO 1 training! »

Technical SEO 1 training$ 199 - Buy now » Info

English article on a Dutch blog

In the video, we explain what options you have to improve the SEO of an article in a language that’s different from your other content:

“In this case, the hreflang tag isn’t even really necessary. The only reason you would use an hreflang is if you had a Dutch version and an English version of the same article. If that’s the case, then you should use hreflang on both articles. In case of a separate article in English, what you should make sure of is that on the English article all the metadata shows that that is an English article and not a Dutch article. Unfortunately this is quite hard to do in WordPress, if you’re not running a multilingual plug-in.

But to be honest, if you’re going to publish in English, maybe you should just make a separate section of your site for it that is completely in English. Adding some more content to it would give you a lot more chance for ranking, than just having one article in English. Of course you have to start somewhere. So by all means create that English section, start with that one article and then slowly add on to it.

It’s always a good idea, if you’re Dutch and your English is good enough, to switch to English. The Dutch language area is only very small and the world is a lot bigger, with a lot of English speakers. So I would really encourage you to start doing stuff in English. Just like we did! I started blogging in English eight years ago, which is why Yoast is so popular now.

Good luck!”

Ask Yoast

In the series Ask Yoast we answer SEO questions from followers. Need some advice about SEO? Let us help you out! Send your question to ask@yoast.com.

Read more: ‘hreflang: the ultimate guide’ »

hreflang: the ultimate guide

hreflang tags are a technical solution for sites that have similar content in multiple languages. The owner of a multilingual site wants search engines to send people to the content in their own language. Say a user is Dutch and the page that ranks is English, but there’s also a Dutch version. You would want Google to show the Dutch page in the search results for that Dutch user. This is the kind of problem hreflang was designed to solve.

In this (very long) article we’ll discuss:

hreflang tags are among the hardest specs I’ve ever seen come out of a search engine. Doing it right is tough and takes time. The aim of this guide is to prevent you from falling into common traps, so be sure to read it thoroughly if you’re embarking on an hreflang project.

Need help implementing hreflang as part of your international SEO project? Our Multilingual SEO training is designed to help you understand the process and put it into practice. You’ll have a killer international SEO strategy in no time. 

What are hreflang tags for?

hreflang tags are a method to mark up pages that are similar in meaning but aimed at different languages and/or regions. There are three common ways to implement hreflang:

  • Content with regional variations like en-us and en-gb.
  • Content in different languages like en, de and fr.
  • A combination of different languages and regional variations.

hreflang tags are fairly commonly used to target different markets that use the same language – for example, to differentiate between the US and the UK, or between Germany and Austria.

What’s the SEO benefit of hreflang?

So why are we even talking about hreflang? What is the SEO benefit? From an SEO point of view, there are two main reasons why you should implement it.

First of all, if you have a version of a page that you have optimized for the users’ language and location, you want them to land on that page. Having the right language and location dependent information improves their user experience and thus leads to fewer people bouncing back to the search results. Fewer people bouncing back to the search results leads to higher rankings.

The second reason is that hreflang prevents the problem of duplicate content. If you have the same content in English on different URLs aimed at the UK, the US, and Australia, the difference on these pages might be as small as a change in prices and currency. Without hreflang, Google might not understand what you’re trying to do and see it as duplicate content. With hreflang, you make it very clear to the search engine that it’s (almost) the same content, just optimized for different people.

What is hreflang?

hreflang is code, which you can show to search engines in three different ways – and there’s more on that below. By using this code, you 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.

What does hreflang achieve?

Who supports hreflang?

hreflang is supported by Google and Yandex. Bing doesn’t have an equivalent but does support language meta tags.

In a complete hreflang implementation, every URL specifies which other variations are available. When a user searches, Google goes through the following process:

  1. it determines that it wants to rank a URL;
  2. it checks whether that URL has hreflang annotations;
  3. it presents the searcher with the results with the most appropriate URL for that user.

The user’s current location and his language settings determine the most appropriate URL. A user can have multiple languages in his browser’s settings. For example, I have Dutch, English, and German in there. The order in which these languages appear in my settings determines the most appropriate language.

Should you use hreflang?

Tip: homepage first!

If you’re not sure on whether you want to implement hreflang on your entire site, start with your homepage! People searching for your brand will get the right page. This is a lot easier to implement and it will “catch” a large part of your traffic.

Now we’ve learned on what hreflang is and how it works, we can decide whether you should use it. You should use it if:

  • you have the same content in multiple languages;
  • you have content aimed at different geographic regions but in the same language.

It doesn’t matter whether the content you have resides on one domain or multiple domains. You can link variations within the same domain but can also link between domains.

Hreflang_mistakes_FI

Architectural implementation choices

One thing is very important when implementing hreflang: don’t be too specific! Let’s say you have three types of pages:

  • German
  • German, specifically aimed at Austria
  • German, specifically aimed at Switzerland

You could choose to implement them using three hreflang attributes like this:

  • de-de targeting German speakers in Germany
  • de-at targeting German speakers in Austria
  • de-ch targeting German speakers in Switzerland

However, which of these three results should Google show to someone searching in German in Belgium? The first page would probably be the best. To make sure that every user searching in German who does not match either de-at or de-ch gets that one, change that hreflang attribute to just de. In many cases, specifying just the language is a smart thing to do.

It’s good to know that when you create sets of links like this, the most specific one wins. The order in which the search engine sees the links doesn’t matter; it’ll always try to match from most specific to least specific.

Technical implementation – the basics

Regardless of which type of implementation you choose – and there’s more on that below – there are three basic rules.

1. Valid hreflang attributes

The hreflang attribute needs to contain a value that consists of the language, which can be combined with a region. The language attribute needs to be in ISO 639-1 format (a two-letter code).

Wrong region codes

Google can deal with some of the common mistakes with region codes, although you shouldn’t take any chances. For instance, it can deal with en-uk just as well as with the “correct” en-gb. However, en-eu does not work, as eu doesn’t define a country.

The region is optional and should be in ISO 3166-1 Alpha 2 format, more precisely, it should be an officially assigned element. Use this list from Wikipedia to verify you’re using the right region and language codes. This is where things often go wrong: using the wrong region code is a very common problem.

2. Return links

The second basic rule is about return links. Regardless of your type of implementation, each URL needs return links to every other URL, and these links should point at the canonical versions, more on that below. The more languages you have the more you might be tempted to limit those return links – but don’t. If you have 80 languages, you’ll have hreflang links for 80 URLs, and there’s no getting around it.

3. hreflang link to self

The third and final basic rule is about self-links. It may feel weird to do this, just as those return links might feel weird, but they are essential and your implementation will not work without them.

Technical implementation choices

There are three ways to implement hreflang:

  • using link elements in the <head>
  • using HTTP headers
  • or using an XML sitemap.

Each has its uses, so we’ll explain them and discuss which you should choose.

1. HTML hreflang link elements in your <head>

The first method to implement hreflang we’ll discuss is HTML hreflang link elements. You do this by adding code like this to the <head> section of every page:

<link rel="alternate" href="http://example.com/" 
  hreflang="en" />
<link rel="alternate" href="http://example.com/en-gb/" 
  hreflang="en-gb" />
<link rel="alternate" href="http://example.com/en-au/" 
  hreflang="en-au" />

As every variation needs to link to every other variation, these implementations can become quite big and slow your site down. If you have 20 languages, choosing HTML link elements would mean adding 20 link elements as shown above to every page. That’s 1.5KB on every page load, that no user will ever use, but will still have to download. On top of that, your CMS will have to do several database calls to generate all these links. This markup is purely meant for search engines. That’s why I would not recommend this for larger sites, as it adds far too much unnecessary overhead.

2. hreflang HTTP headers

The second method of implementing hreflang is through HTTP headers. HTTP headers are for all your PDFs and other non-HTML content you might want to optimize. Link elements work nicely for HTML documents, but not for other types of content as you can’t include them. That’s where HTTP headers come in. They should look like this:

Link: <http://es.example.com/document.pdf>; 
rel="alternate"; hreflang="es", 
<http://en.example.com/document.pdf>; 
rel="alternate"; hreflang="en", 
<http://de.example.com/document.pdf>; 
rel="alternate"; hreflang="de"

The problem with having a lot of HTTP headers is similar to the problem with link elements in your <head>: it adds a lot of overhead to every request.

3. An XML sitemap hreflang implementation

The third option to implement hreflang is using XML sitemap markup. It uses the xhtml:link attribute in XML sitemaps to add the annotation to every URL. It works very much in the same way as you would in a page’s <head> with <link> elements. If you thought link elements were verbose, the XML sitemap implementation is even worse. This is the markup needed for just one URL with two other languages:

<url>
  <loc>http://www.example.com/uk/</loc> 
  <xhtml:link rel="alternate" hreflang="en" 
 href="http://www.example.com/" /> 
  <xhtml:link rel="alternate" hreflang="en-au" 
 href="http://www.example.com/au/" /> 
  <xhtml:link rel="alternate" hreflang="en-gb" 
 href="http://www.example.com/uk/" />
</url>

You can see it has a self-referencing URL as the third URL, specifying the specific URL is meant for en-gb, and it specifies two other languages. Now, both other URLs would need to be in the sitemap too, which looks like this:

<url>
  <loc>http://www.example.com/</loc> 
  <xhtml:link rel="alternate" hreflang="en" 
 href="http://www.example.com/" /> 
  <xhtml:link rel="alternate" hreflang="en-au" 
 href="http://www.example.com/au/" /> 
  <xhtml:link rel="alternate" hreflang="en-gb" 
 href="http://www.example.com/uk/" />
</url>
<url>
  <loc>http://www.example.com/au/</loc> 
  <xhtml:link rel="alternate" hreflang="en" 
 href="http://www.example.com/" /> 
  <xhtml:link rel="alternate" hreflang="en-au" 
 href="http://www.example.com/au/" /> 
  <xhtml:link rel="alternate" hreflang="en-gb" 
 href="http://www.example.com/uk/" />
</url>

As you can see, basically we’re only changing the URLs within the <loc> element, as everything else should be the same. With this method, each URL has a self-referencing hreflang attribute, and return links to the appropriate other URLs.

XML sitemap markup like this is very verbose: you need a lot of output to do this for a lot of URLs. The benefit of an XML sitemap implementation is simple: your normal users won’t be bothered with this markup. You don’t end up adding extra page weight and it doesn’t require a lot of database calls on page load to generate this markup.

Another benefit of adding hreflang through the XML sitemap is that it’s usually a lot easier to change an XML sitemap than to change all the pages on a site. There’s no need to go through large approval processes and maybe you can even get direct access to the XML sitemap file.

Other technical aspects of an hreflang implementation

Once you’ve decided your implementation method, there are a couple of other technical considerations you should know about before you start implementing hreflang.

hreflang x-default

x-default is a special hreflang attribute value that specifies where a user should be sent if none of the languages you’ve specified in your other hreflang links match their browser settings. In a link element it looks like this:

<link rel="alternate" href="http://example.com/" 
  hreflang="x-default" />

When it was introduced, it was explained as being for “international landing pages”, ie pages where you redirect users based on their location. However, it can basically be described as the final “catch-all” of all the hreflang statements. It’s where users will be sent if their location and language don’t match anything else.

In the German example we mentioned above, a user searching in English still wouldn’t have a URL that fits them. That’s one of the cases where x-default comes into play. You’d add a fourth link to the markup, and end up with these 4:

  • de
  • de-at
  • de-ch
  • x-default

In this case, the x-default link would point to the same URL as the de one. We wouldn’t advise you to remove the de link though, even though technically that would create exactly the same result. In the long run, it’s usually better to have both as it specifies the language of the de page – and it makes the code easier to read.

hreflang and rel=canonical

rel="canonical"

If you don’t know what rel=”canonical” is, read this article!

rel=”alternate” hreflang=”x”markup and rel=”canonical” can and should be used together. Every language should have a rel=”canonical” link pointing to itself. In the first example, this would look like this, assuming that we’re on the example.com homepage:

<link rel="canonical" href="http://example.com/">
<link rel="alternate" href="http://example.com/" 
  hreflang="en" />
<link rel="alternate" href="http://example.com/en-gb/" 
  hreflang="en-gb" />
<link rel="alternate" href="http://example.com/en-au/" 
  hreflang="en-au" />

If we were on the en-gb page, only the canonical would change:

<link rel="canonical" href="http://example.com/en-gb/">
<link rel="alternate" href="http://example.com/" 
  hreflang="en" />
<link rel="alternate" href="http://example.com/en-gb/" 
  hreflang="en-gb" />
<link rel="alternate" href="http://example.com/en-au/" 
  hreflang="en-au" />

Don’t make the mistake of setting the canonical on the en-gb page to http://example.com/, as this breaks the implementation. It’s very important that the hreflang links point to the canonical version of each URL, because these systems should work hand in hand!

Useful tools when implementing hreflang

If you’ve come this far, you’ll probably be thinking “wow this is hard”! I know – I thought that when I first start to learn about it. Luckily, there are quite a few tools available if you dare to start implementing hreflang.

hreflang tag generator

The hreflang tags generator tool

Aleyda Solis, who has also written quite a lot about this topic, has created a very useful hreflang tag generator that helps you generate link elements. Even when you’re not using a link element implementation, this can be useful to create some example code.

hreflang XML sitemap generator

The Media Flow have created an hreflang XML sitemap generator. Just feed it a CSV with URLs per language and it creates an XML sitemap. This is a great first step when you decide to take the sitemap route.

The CSV file you feed this XML sitemap generator needs a column for each language. If you want to add an x-default URL to it as well, just create a column called x-default.

hreflang tag validator

hreflang tag validator

Once you’ve added markup to your pages, you’ll want to validate it. If you choose to go the link element in the <head> route, you’re in luck, as there are a few validator tools out there. The best one we could find is flang, by DejanSEO.

Unfortunately, we haven’t found a validator for XML sitemaps yet.

Making sure hreflang keeps working: process

Once you’ve created a working hreflang setup, you need to set up maintenance processes. It’s probably also a good idea to regularly audit your implementation to make sure it’s still set up correctly.

Make sure that people in your company who deal with content on your site know about hreflang so that they won’t do things that break your implementation. Two things are very important:

  1. When a page is deleted, check whether its counterparts are updated.
  2. When a page is redirected, change the hreflang URLs on its counterparts.

If you do that and audit regularly, you shouldn’t run into any issues.

Conclusion

Setting up hreflang is a cumbersome process. It’s a tough standard with a lot of specific things you should know and deal with. This guide will be updated as new things are introduced around this specification and best practices evolve, so check back when you’re working on your implementation again!

Read more: rel=canonical: what is it and how (not) to use it »

The post hreflang: the ultimate guide appeared first on Yoast.

Use hreflang for multilingual websites

Use hreflang for multilingual websitesThe hreflang tag is used to tell Google and other search engines the language used on a specific page on your website. Search engines use the hreflang tag to ‘redirect’ the visitor to the page in the right language. Hreflang is also referred to as rel="alternate" hreflang="x".

When I was discussing post subjects with our site review team, Annelieke pointed out that hreflang was mentioned on our website, but that we never did an article about it. Perhaps that is because for most sites, hreflang isn’t a ranking related issue. For the larger sites it could be, by the way. In this post, I’d like to explain a bit more about multilingual websites and how hreflang is important for these sites.

What is multilingual

Let’s start at the beginning. What is multilingual? In our online context it basically means that content is available in more than one language.

This can be cross border, for instance French or Chinese, but there is a bit more to that. It can also mean a language variation (so to speak) is available, like our next door neighbors the Belgians have. In Belgium, some speak Flemmish (which is like Dutch) and some speak Walloon (which is like French). More on this later, as we discuss hreflang types. Of course multilingual can also mean people speaking Spanish in an English speaking country. Yes, you can target those as well. It’s all multilingual.

International rankings

In an ideal world, you would have a separate website with it’s own TLD (Top Level Domain) for each language you want to target, like amazon.de and amazon.co.uk. Ideally, these websites would be hosted on a server in the country you want to target. And all should be linked using the hreflang tag from the start. It’s similar to ranking locally: if you are in the location your target audience is in, you’re probably relevant to that audience to Google as well.

All this might be the preferred way to do things, but it has its limitations. What to do when the TLD is already taken, for instance. It also requires you to purchase more domain names, of course. It’s the best way, but also the way that requires most effort. A lot of international websites have grouped their online activities in one location, one country, and manage all the different languages from there. In that case, you can still use hreflang to your benefit, as hreflang can target both language and country for you.

Lastly, you should also tell Google your preferred geo-audience in Google Webmaster Tools. You can find that at Search Traffic > International Targeting > Country > Geographical Target.

Hreflang is your friend

If your website serves pages in multiple languages, or your website itself is served in more than one language, you should make hreflang your friend. There is a number of ways that hreflang can help Google understand these variations.

Google mentions the use of rel="alternate" hreflang="x" at least in these three cases:

  • Translate only the template parts, like the navigation and footer, while using one language, f.i. English, for the content. This could be the case for website that consist mainly of user-generated content like a forum.
  • There are small regional variations, but most of the text is the same, like variations of English used in the United States, Great Britain and Ireland.
  • The entire site is translated into other languages than the original.

I’d like to add one. You can also add hreflang="x", where x is the language, to a link. In that case, the hreflang attribute should reflect the language of the page in the link. That way, you are telling Google that there will be a different language at the other side of that link. This is especially useful for sites that actually tell the visitor the site or page is available in other languages as well by linking these pages.

Locations of hreflang

Besides in the link mentioned in the section above, there are a couple of ways to tell Google about the language variations:

  1. Place an HTML link in the header. You could add a language alternative to your <head> like this:
    <link rel="alternate" hreflang="nl" href="http://nl.example.com/" />
  2. In your HTTP header, for instance via your .htaccess file. This is mainly for non-HTML files like PDF’s and might look something like this:
    Link: <http://nl.example.com/>; rel="alternate"; hreflang="nl"
  3. XML sitemap. You can also add language alternatives via your sitemap. This is a bit more technical; read more about it in Webmaster Tools.

Examples of language indicators

Let’s go over a number of variations to make this all just a bit more clear. For starters, you want to make sure all languages are covered, even the ones you are not targeting. You can easily add a ‘default’ page by setting an x-default hreflang element:

<link rel="alternate" href="http://example.com/" hreflang="x-default" />

This simply indicates that if none of the alternate links is matched, this page should be served.

That x-default can be replaced by a language and a country like this:

<link rel="alternate" href="http://example.com/en-gb" hreflang="en-gb" />

That is a hreflang setting for all English speakers in Great Britain / United Kingdom (UK). This also points out the importance of the x-default, as this line only targets the visitors that come from the UK (server side) and prefer the English language (client side).

As mentioned, alternative could be:

<link rel="alternate" href="http://example.com/en-us" hreflang="en-us" />
<link rel="alternate" href="http://example.com/en-au" hreflang="en-au" />

By the way, I have seen en-us and en-US, for China it could even be zh-Hans. I don’t think there is a right and wrong in uppercase/lowercase. Even Google uses both in one article. I have also seen brave tries to use en_GB, but that underscore won’t work; it needs to be a hyphen.

One more thing

To finish things off, you also want to add a notice of these alternative pages via OpenGraph:

  • The locale these tags are marked up in. Note that OpenGraph does use an underscore.
    <meta property="og:locale" content="en_GB" />
  • An array of other locales this page is available in.
    <meta property="og:locale:alternate" content="fr_FR" />
    <meta property="og:locale:alternate" content="es_ES" />

More on that for instance on the Facebook developers pages.

Hreflang and SEO

The big question for us of course is “what will this all do for SEO?” Well, that seems to depend on for instance the size of the site and the way the content in the original language is already indexed.

I have read a number of case studies, and have discussed it with colleagues. If your website ranks well, and has a significant size, adding a new language and hreflang tags might indeed help the rankings of the ‘new’ website. Google might even index all as one (if it’s one domain), which means a lot more pages for the main domain will be indexed. If these are all of quality, that obviously won’t hurt.

Having said that, the other way around also seems to be the case. Low rankings for your main site won’t help the language alternatives. And for smaller sites, the overall impact seems to be very little.

Should you add hreflang? Yes, you should. Will it help your SEO / rankings? It might.

Some of the case studies that led to that believe:

Your call

I hope this post brought you some more understanding of the hreflang tag. If you have a multilingual site, it will help Google understand your site. And that alone should be a reason to add it.

Next to that, I’m very much looking forward to reading your thoughts on this subject and even more to your own case study or studies. Feel free to link your hreflang case study in the comments!

Thanks for reading

This post first appeared as Use hreflang for multilingual websites on Yoast. Whoopity Doo!