Most blogs don't need international SEO. If your site is in one language and you have no plans to translate it, there's nothing to set up. Google works out a page's language from the text on it and can show that page to people searching in that language anywhere in the world. Readers in other countries finding your English articles is normal and needs no hreflang. Your time is better spent on the basic SEO checks that apply to every site.
You need it once you publish real alternate versions of the same page: a Spanish translation of an English guide, say, or separate US and UK editions with different prices and spelling. From then on you have two jobs. Give every version its own URL, and tell Google which URLs are versions of each other. The second job is what hreflang is for.
Keep one distinction in mind throughout: language and country are different targets. Spanish is a language spoken in many countries; Mexico is a country. You can target either or both, and the choices below depend on which one you mean.
Choosing a URL structure for other languages or countries
Google recommends a separate URL for each language version, and advises against swapping the language on a single URL with cookies or browser settings. Its guide to managing multi-regional and multilingual sites lists three workable structures. It also lists URL parameters such as ?loc=de and says it doesn't recommend them.
| Structure | In its favor | Trade-offs |
|---|---|---|
Country domain: example.de | Clearest country signal; server location doesn't matter | Costs more, needs more infrastructure, some country domains have registration rules, targets one country only |
Subdomain: de.example.com | Easy to set up; easy to keep the sites separate | A reader can't tell whether "de" means the German language or Germany |
Subdirectory: example.com/de/ | Easy to set up; low maintenance on one host | Same ambiguity in the URL; one server location; harder to separate the sites later |
A country domain targets a country, so it's a poor fit for a language spoken in many places. There's no single country domain for "Spanish speakers".
For a blog adding one or two languages, I'd use subdirectories. It's one site, one host and one analytics property to look after. You'll often read that subdirectories also "share authority" with the main site while subdomains start from nothing. Google's documentation doesn't say that, so I wouldn't treat it as settled. Pick the structure you can maintain, because moving later means redirecting every URL.
How hreflang works
Hreflang tells Google that a set of URLs are localized versions of the same content, so it can show a searcher the version that matches their language or region. That's all it does. Google's page on telling it about localized versions describes it as a way to choose between your versions and says nothing about ranking any of them higher. A Spanish page still has to earn its place in Spanish results.
Google may find your alternate versions without it, but it says explicit annotation is usually best. The rules are short:
- Language code first. Use an ISO 639-1 language code, such as
esorde. You can add an ISO 3166-1 Alpha 2 region code after a hyphen, as ines-MX. Language on its own is valid. Region on its own isn't. - Every version lists itself and all the others. The English page carries the full set, and so does the Spanish page.
- Links must go both ways. Google's wording is blunt: if two pages don't both point to each other, the tags will be ignored.
- Use full URLs, including
https://. The versions can sit on different domains. x-defaultis the fallback. It names the page to use when none of your versions matches the searcher's browser language. A language-picker page or your main version both work.
Here's a correct set for an English guide with a general Spanish version and a Mexico-specific one:
<link rel="alternate" hreflang="en" href="https://example.com/guide/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/guide/" />
<link rel="alternate" hreflang="es-MX" href="https://example.com/es-mx/guide/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/guide/" />
The identical four lines go in the <head> of all three pages. That takes care of the self-reference and the return links in one go.
The three ways to add it
- HTML link tags in the
<head>, as above. Simplest when you control the page template. - HTTP headers. A
Link:header sent with the page. Google suggests this for files that have no HTML head, such as PDFs. - XML sitemap. Each URL entry lists all its alternates. This keeps the annotations in one file, which is easier to manage on a large site or one where you can't edit the templates.
Google says the three are equivalent from its side, so choose whichever is easiest to keep accurate. I'd pick one and stick with it, because two methods that disagree are harder to debug than one.