Free auditStart free
GuideStrapi · International SEO

Strapi hreflang

Strapi's i18n feature stores locales, but docs do not mention hreflang. Set up locales, fetch each one, and emit hreflang from your frontend.

3 min
read
3
sources
Oct 30, 2026
updated
Scaplet Editorial Team
author
In one line

Strapi's Internationalization feature manages locales and localized content, but its docs do not mention hreflang, so your frontend has to emit the tags. Add locales under Settings > Global Settings > Internationalization, enable localization on the content type, then output one alternate link per published locale, including a self-reference.

30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
01Strapi i18n versus hreflang, from Strapi's docs

What Strapi gives you, and what it does not

NeedStrapiSource
Add localesYes - Settings > Global Settings > InternationalizationInternationalization docs
Custom locale codesNo - "It is not possible to create custom locales."Internationalization docs
Localize a content type or fieldYes - tick Internationalization in the Content-type Builder's Advanced settings, then "Enable localization for this field"Internationalization docs
Publish one language at a timeYes - publishing applies only to the locale you are working inInternationalization docs
Fetch one locale over RESTYes - the locale parameterREST locale docs
Output hreflang tagsNot documented - the i18n page does not mention hreflangYour frontend

By default only the English locale is configured, and only one locale can be the default for the whole application. An omitted locale parameter returns the default locale.

02How it works

Set up locales and fetch each one

Strapi's REST locale example
curl 'http://localhost:1337/api/restaurants?locale=fr' \
  -H 'Authorization: Bearer <token>'
  1. 01

    Add locales

    Go to Settings > Global Settings > Internationalization and add the locales from Strapi's pre-created list. Pick the default carefully, since only one can be the default.

  2. 02

    Enable localization on the content type and fields

    In the Content-type Builder's Advanced settings tab, tick Internationalization on the content type, and Enable localization for this field on each field that varies by language.

  3. 03

    Create and publish each translation

    In the Content Manager, use the locale drop-down at the top right of the edit view to switch language. Fill in from another locale copies values across. Publish each locale separately.

  4. 04

    Request a locale

    Pass the locale parameter on the REST API, as in the example below.

03Checklist

Emit hreflang from the frontend

Google lists three ways to indicate alternate versions: HTML tags, HTTP headers, or an XML sitemap. Strapi's docs cover none of them, so choose one in your frontend. The rules come from Google: each language version must list itself and all other versions, alternate URLs must be fully qualified including http or https, and "If two pages don't both point to each other, the tags will be ignored."
  1. 01Build the list from the locales you have actually published for that entry, so you never link to a locale that returns a 404.
  2. 02Use only ISO 639-1 language codes and ISO 3166-1 Alpha 2 region codes. Google says codes such as es-419 are not supported.
  3. 03Google says the reserved x-default value is used when no other language or region matches the visitor.
  4. 04Make sure the locale codes you configured in Strapi map cleanly to those hreflang values, since Strapi's pre-created list is the only source of locale codes.
One page in three locales (example URLs)
<link rel="alternate" hreflang="en" href="https://example.com/en/pricing" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/tarifs" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/pricing" />
04How it works

Check it worked

  1. 1

    Read the rendered head

    View source on one page in each locale and confirm it lists itself plus every sibling.

  2. 2

    Follow every alternate

    Open each alternate URL and confirm it returns 200 with that locale's content and links back to the others.

  3. 3

    Compare with the API

    Request each locale with ?locale= and confirm each is published, since the Content Manager publishes per locale.

More on the markup in the hreflang glossary entry, and on the title and description side in Strapi title and meta.

Related Strapi guide: Strapi title tags and meta descriptions.

Questions

Asked a lot.

2 questions people ask next, answered from the sources on this page.

01Does Strapi add hreflang tags?

Strapi's Internationalization docs do not mention hreflang. Your frontend has to output the tags using the locales Strapi stores.

02Can I create a custom locale in Strapi?

No. Strapi's docs say it is not possible to create custom locales; you choose from its pre-created list.

Sources · 3

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • strapi.io
  • google.com
  1. 01Internationalization (i18n) | Strapi Docsdocs.strapi.io · checked 2026-11-01
  2. 02REST API: locale | Strapi Docsdocs.strapi.io · checked 2026-11-01
  3. 03Localized versions of your pages | Google Search Centraldevelopers.google.com · checked 2026-11-01
Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane