- On-page SEO
- Explainer
Hreflang for Bloggers: When You Need It and How to Add It
Editorial responsibility: SearchCub
Use hreflang when the same post exists in more than one language or regional version, each at its own URL: list every version, the page itself included, on each of those versions, and it helps Google Search point each searcher to the most suitable one. If each of your posts exists in only one version, there is nothing for hreflang to connect. Everything below follows Google's guide to localized versions, last updated 21 September 2026, and its guide to multilingual and multi-regional sites, last updated 10 December 2025.
When a blog needs hreflang
Google gives three example situations in which it recommends marking alternate versions (Google: localized versions), and each has a blog equivalent:
Translated posts. The same post in English and in Spanish. Google's example is a site that has every page in both German and English.
Regional versions in one language. A US and a UK edition of a post that differ in small ways, such as prices in dollars and in pounds. Google's example is English content for readers in the US, the UK and Ireland.
Only the template translated. Menus and footer switch language while each post stays in one. Google notes that forums and other pages built on user-generated content often work this way, but its multilingual guide warns that the same content turning up in results several times, with only the template language changed, can make a poor experience.
Google may find your language versions without annotations, but it says marking them explicitly is usually the better choice.
Hreflang can't help in three other setups:
Both languages on one page. Hreflang connects separate URLs, so a two-language page has nothing to connect. Google's multilingual guide also advises one language for each page's content and navigation, with no side-by-side translations (Google: multilingual sites).
One URL that switches language by cookie or browser setting. Google recommends a separate URL for each language version (Google: multilingual sites). When content changes with a visitor's settings, Google might not discover and crawl every variation, because Googlebot usually crawls from the US and its requests carry no
Accept-Languageheader.A post with no counterpart. A Spanish post that isn't a version of any English post has no alternate to list.
For regional versions, Google's guide weighs country domains such as example.de, subdomains such as de.example.com and subfolders such as example.com/de/, and doesn't recommend URL parameters such as ?loc=de; country endings are covered in does your domain name affect SEO.
Two things to know before you start
Hreflang doesn't tell Google what language a page is in. Google determines that with its own algorithms from the visible content, and it doesn't use hreflang, the HTML
langattribute or the URL for that job (Google: localized versions, multilingual sites). So write each version's visible text in its own language.A translation isn't a duplicate. Google treats localized versions as duplicates only when the main content is left untranslated (Google: localized versions).
Pick one of the three methods
Google treats its three methods as equivalent, so you can choose whichever is most convenient for your site (Google: methods). Using all three at once brings no benefit in Search, Google says, and can be much harder to manage than picking one.
Link tags in the head. Each version's HTML
<head>holds one<link>element per version, the page itself included, each withrel="alternate", anhreflangcode and a full URL. Google notes this is useful for sites without a sitemap or a way to set HTTP response headers.HTTP headers. Your server sends a
Link:header listing every version's URL in angle brackets, each withrel="alternate"and itshreflangcode, separated by commas, and the header is the same for every version. Google notes this suits files that aren't HTML, such as a PDF guide you offer in two languages.Sitemap. Your XML sitemap gives each version its own
<url>entry, and every entry lists all the versions, itself included, as<xhtml:link>child elements.
If a translation plugin or your platform creates the language versions, search a translated post's HTML source and your sitemap for hreflang before adding anything. If the tags are already there, check them against the rules below instead of adding a second set.
Example: one post in English and Spanish
This is a teaching example, not a real site. A baking blog publishes https://example.com/sourdough-starter/ in English and its Spanish translation at https://example.com/es/masa-madre/. With link tags, both pages carry the same three lines in their <head>:
<link rel="alternate" hreflang="en" href="https://example.com/sourdough-starter/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/masa-madre/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/sourdough-starter/" />Each page lists itself and the other one, so the links run both ways. The x-default line names the English post as the fallback for readers whose language matches neither version.
In a sitemap, the same set takes one <url> entry per version, and each entry repeats the full set:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://example.com/sourdough-starter/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/sourdough-starter/"/>
<xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/masa-madre/"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/sourdough-starter/"/>
</url>
<url>
<loc>https://example.com/es/masa-madre/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/sourdough-starter/"/>
<xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/masa-madre/"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/sourdough-starter/"/>
</url>
</urlset>Google's sitemap instructions also ask you to declare the xhtml namespace, as the opening <urlset> tag above does. The child entries can come in any order, and they don't count toward a sitemap's URL limit. To find and submit your blog's sitemap, see XML sitemaps: does your blog need one.
The rules for every method
These rules apply to tags, headers and sitemaps alike (Google: rules for all methods):
Each version lists itself and every other version. In Google's words, each language version "must list itself as well as all other language versions." The set is identical on every version.
Links must run both ways. Google ignores a pair of tags unless both pages point to each other, so a stranger's site can't claim to be a version of your post.
URLs must be complete. Write
https://example.com/es/masa-madre/, not/es/masa-madre/or//example.com/es/masa-madre/.Versions can sit on different domains. A Spanish edition on its own domain can still be part of the set.
One language in several regions: add a general version. With
en-USanden-GBversions, Google calls it a good idea to also list a URL under plainenfor English speakers everywhere else. That URL can be one of the regional pages.Large sets can be partial. If keeping every pair complete gets difficult, you can leave some languages off some pages, and Google still processes the pairs that point to each other. Google says that linking each new language both ways with the original language matters more than linking the new languages to each other.
When you add a version, update the others: a French translation of the starter post means one more line on the English and Spanish pages, and the full set on the French page.
Language and region codes
An hreflang value is a language code, optionally followed by a hyphen and a region code (Google: supported codes):
Language comes first. It must be an ISO 639-1 code, such as
esfor Spanish. A region code on its own is not valid.The region is optional. It must be an ISO 3166-1 Alpha 2 code, as in
en-GBfor English speakers in the UK.Other codes are not supported. Google gives
es-419as an example of a code outside those two standards.Use
GBfor the United Kingdom. Google Search ignores the region part when it is a code reserved for something else, such asUK,EUorUN.Watch for look-alikes. The first code is the language, so
beon its own means Belarusian, not Belgium; French for readers in Belgium isfr-BE.Name a script where it matters. For Chinese, you can use an ISO 15924 script code, as in
zh-Hansfor Simplified andzh-Hantfor Traditional.
Google accepts the codes in lower or upper case; writing the region in capitals, as in the examples here, follows the ISO convention.
x-default: the fallback for everyone else
x-default is a reserved value for readers whose language settings match none of your versions (Google: x-default). It takes no language code: you point it at the URL where you want those readers to land. Google designed it for language selector pages and says it works best there, though you can use it on any page. On a blog without a selector page, point it at the version you want everyone else to see, such as your original post, and use the same x-default line on every version.
Common mistakes
Google's troubleshooting section names three as the most common, all covered above: a listed page that doesn't link back, an invalid language code (a region code on its own is not valid), and a region code reserved for something else. Where a page doesn't link back, Google may ignore the annotations or read them wrongly. Its guidance also flags these:
Tags outside the head. The link tags must sit inside a well-formed
<head>. If you're unsure, Google suggests copying your rendered page's code into an HTML validator.hreflang combined with another attribute, such as
media, inside one<link>element.Redirecting readers by language. Google's multilingual guide advises against sending readers to the version you guess they want, because those redirects can keep people and search engines from seeing every version (Google: multilingual sites). Link the versions to each other on the page instead, so readers can switch themselves.
How to check your tags
If you used link tags, open each version of a post, view its HTML source and search for hreflang. If you used your sitemap, open the sitemap file and read each version's <url> entry instead; for HTTP headers, check the Link: header returned with each version. Confirm that every version carries the same set, that each page appears in its own set, that every URL is complete and that each code follows the rules above. Google's page also points to two third-party tools, a tag generator by Aleyda Solis and a Merkle tool that tests the tags on one live page, and notes that Google neither maintains nor checks them (Google: tools for checking tags).
If a guide sends you to Search Console's International Targeting report, note that Search Console Help says the report has been deprecated, adding: "Google will continue to support and use hreflang tags on your pages." If one version doesn't show up in Google at all, check whether it is indexed before you change your tags: why Google hasn't indexed your page walks through that.
What to do on a small blog
List the posts that exist in more than one version, with each version's full URL.
Choose the one method your setup makes easiest, and keep to it.
Put the complete set, plus an
x-defaultline if you want a fallback, on every version.Link the versions to each other on the page, and update every set when you add a version.
Deciding what should change between versions is a separate job, and content localization covers it. For the wider question of how your site is doing in search, see how to check your website's SEO performance.