Skip to content
50% OFF $299 $599
Lock in
§ 6.0.14 ARTICLE
Published VerifiedEvery 6 weeks Sources2 named Authored bySquareRank Team

Glossary · § 6.0.14 · Defined term

hreflang

hreflang is the rel-alternate annotation that maps URLs to the language and (optionally) region they target1, telling Google which localized version of a page to show to which user. It's expressed as <link rel="alternate" hreflang="en-us" href="..."> in the page head, in the XML sitemap, or as an HTTP header.

hreflang only matters for sites with multilingual or multi-regional content. A monolingual Squarespace site does not need hreflang and should not emit it. A multilingual site without hreflang will work imperfectly — Google will sometimes show the wrong language to the wrong user.

Definition

hreflang is the rel-alternate annotation that maps URLs to the language and (optionally) region they target, telling Google which localized version of a page to show to which user. It's expressed as <link rel="alternate" hreflang="en-us" href="..."> in the page head, in the XML sitemap, or as an HTTP header.

The value of hreflang is a language code (ISO 639-1, two letters: en, de, fr) optionally followed by a region code (ISO 3166-1 Alpha 2, two letters: us, de, fr), separated by a hyphen. Examples: en (English, no region), en-us (US English), de-at (Austrian German). A special value x-default declares the fallback URL when no language/region match is found.

hreflang syntax and the three placement options

Three valid places to declare hreflang. (1) In the page head as link elements, one per language/region variant. (2) In the XML sitemap, one xhtml:link per variant per URL. (3) As an HTTP Link header for non-HTML resources. Each language/region pair must appear in all variants — if /en/ declares /de/ as a variant, /de/ must also declare /en/ as a variant. The relationship is reciprocal.

For most Squarespace sites the only viable option is (1) — head-element placement via Code Injection. Squarespace's auto-generated sitemap does not include xhtml:link annotations; the HTTP-header option is impossible without server-level access Squarespace does not provide. The head-element option works but requires the same Code-Injected block on every multilingual page.

Common hreflang errors

Five common errors. (1) Missing reciprocal — /en/ declares /de/ but /de/ doesn't declare /en/. (2) Wrong language code — using zh-cn for 'Chinese (mainland)' when Google expects zh-Hans or zh-CN; the format matters. (3) Self-referencing only — every page must list itself plus all its alternates. (4) Conflicting canonical — hreflang declares /en/ as a variant but the canonical points to /de/. (5) Region without language — hreflang must have a language; hreflang="us" alone is invalid.

Google's Search Console has an "International Targeting" report that flags hreflang errors on indexed pages. For multilingual Squarespace sites running hreflang via Code Injection, audit that report monthly — the most common error pattern is a Code-Inject typo that propagates to every page.

hreflang on Squarespace specifically

Squarespace does not natively support hreflang. The platform's official multilingual approach is to build separate sites or subdirectory-based language splits and to manually handle hreflang via Code Injection. The install pattern: a Code-Injected block in Page Header Code Injection on every multilingual page, declaring all language/region variants including self-reference.

A practical example: a German-and-English site with URLs /de/about and /en/about needs each page to Code-Inject <link rel="alternate" hreflang="de" href="https://yoursite.com/de/about">, <link rel="alternate" hreflang="en" href="https://yoursite.com/en/about">, and optionally <link rel="alternate" hreflang="x-default" href="https://yoursite.com/en/about">. The same three lines on the German page. Reciprocal, self-referencing, and including x-default. For a 30-page site, that's 30 manual injections; for a 300-page site, the platform's limitations start to bite hard2. The detailed install pattern lives at Squarespace hreflang code injection.

hreflang sits inside the international SEO cluster.