If your website publishes content in multiple languages, you have likely faced the challenge of showing the correct version to users in search results. Multilingual SEO is not just about translating content; it requires a precise technical structure so that search engines understand which version of a page to display for which language and region. The hreflang tag is your most important tool in this process. In this article, we will practically review URL structure, how to implement hreflang, and the most common mistakes websites make, with real examples.
Why does multilingual SEO need hreflang?
Imagine a user in Germany searches for "web hosting". If your website has a German version but Google mistakenly shows the English version, both the user experience suffers and the conversion rate drops. The hreflang tag tells Google and Bing which URL should appear in the results for the German language (and the Germany region).
Without hreflang, search engines may:
- Index the wrong version and show it to users of other languages.
- Treat translated pages as duplicate content and lower their rankings.
- Split incoming links between different versions and weaken the authority of the main page.
In fact, hreflang is a clear signal to Google that says: "These pages are versions of each other, not unauthorized copies."
Choosing a URL structure for multilingual SEO
Before anything else, you need to decide how to organize the language versions of your site in the URL. There are three common methods:
1. Subdomain
Example: de.example.com or fa.example.com
This method is technically simple and treats each language as a separate entity. However, it has disadvantages: Google may see subdomains as independent sites, and the authority of the main domain may not be fully transferred to them. Also, managing cookies and sessions across subdomains becomes more complex.
2. Subdirectory
Example: example.com/de/ or example.com/fa/
This method is the most recommended option for most websites. All versions are placed under a single domain, authority flows easily between them, and management is simple. Google clearly understands the folder structure.
3. URL parameter
Example: example.com/?lang=de
We do not recommend this method at all. URL parameters create many indexing problems and Google may ignore them. If you are using this method, be sure to configure the parameters in Google Search Console.
Important note: If your website has content for a specific language in multiple regions (e.g., British and American English), you can use a combination of language and region: example.com/en-gb/ and example.com/en-us/. However, if the content is identical, it is better to use only the language code to avoid unnecessary complexity.
Implementing hreflang: three main methods
After choosing the URL structure, it is time to implement hreflang. There are three standard methods:
1. Link tag in the head section
The simplest method is to add <link> tags in the <head> section of each page. For example, if you have three versions (English, Persian, German), you must place this code on all three pages:
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fa" href="https://example.com/fa/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/" />
The x-default tag specifies the default version to be shown to users whose language is not in the list.
2. HTTP header
For non-HTML files such as PDFs, you can use the HTTP header:
Link: <https://example.com/en/document.pdf>; rel="alternate"; hreflang="en",
<https://example.com/fa/document.pdf>; rel="alternate"; hreflang="fa"
3. Sitemap file
If your website is large, adding hreflang to the sitemap is more efficient. In the XML sitemap file, you can specify alternate versions for each URL:
<url>
<loc>https://example.com/en/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/" />
<xhtml:link rel="alternate" hreflang="fa" href="https://example.com/fa/" />
<xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/" />
</url>
<url>
<loc>https://example.com/fa/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/" />
<xhtml:link rel="alternate" hreflang="fa" href="https://example.com/fa/" />
<xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/" />
</url>
Note that in the sitemap, you must define the xhtml namespace in the <urlset> tag:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
Common mistakes in multilingual SEO and hreflang
Even professional websites make mistakes in implementing hreflang. Below, we review the most common errors:
1. Lack of return tags
If the English page links to the Persian version, the Persian page must also link back to the English version. This is the golden rule of hreflang. If one of the tags is forgotten, Google may ignore the entire set.
2. Using the wrong language code
The language code for Persian is fa, not per or ir. The language code for German is de, not ger. Be sure to use the ISO 639-1 standard. For language and region combinations, use the format en-US or fa-IR.
3. Ignoring x-default
Many websites forget the x-default tag. This tag tells Google which version to show to users whose language is not in the list. Usually, the English version is chosen as the default.
4. Using hreflang for untranslated pages
If you introduce the Persian page as an alternate version of the English page but the content has not been translated yet, Google considers this a negative signal. Only add hreflang when the content is actually translated.
5. Errors in relative URLs
In the hreflang tag, you must use absolute URLs. Relative URLs like /fa/ do not work. Also, make sure the protocol (https) and domain are correctly specified.
Troubleshooting and verifying hreflang correctness
After implementation, you need to verify that your work is correct. There are several ways to do this:
1. Online tools
Websites like hreflang.org or technicalseo.com offer free tools to check hreflang. Simply enter the page URL to see the errors.
2. Google Search Console
In Google's International Targeting section, you can see which version Google has selected for each language. If there is an error, a warning will be shown in this section.
3. Manual check
Using Chrome DevTools, you can inspect the hreflang tags in the page source. You can also use the following command in the terminal:
curl -s https://example.com/en/ | grep hreflang
This command displays all hreflang tags present on the page.
Multilingual SEO beyond hreflang
hreflang is only one part of multilingual SEO. For complete success, also pay attention to the following:
- Clean URL structure: Use keywords in URLs, not numeric identifiers.
- Professional translation: Machine translation without human editing can damage the site's credibility.
- Local meta tags: Optimize titles and meta descriptions for each language, not literal translations.
- HTML language: Set the
<html lang="fa">tag correctly on each page. - Loading speed: Language versions should be hosted on appropriate servers (geographically).
If you are looking for the right infrastructure for your multilingual website, ServerNet offers a variety of hosting options that you can choose from based on your needs.
Conclusion
Multilingual SEO is an ongoing process, not a one-time setup. Proper URL structure, correct hreflang implementation, and regular error checking are the three main pillars of success in this area. Remember that hreflang is a signal, not a definitive command; Google may make a different decision in some cases. But by following the principles we discussed in this article, you maximize the chances of showing the correct version to users.
After implementation, wait at least one month and then review the results in Google Search Console. If the language versions are properly indexed and the click-through rate (CTR) has improved, it means you have done your job correctly.
Comments 0
No comments yet — be the first!