ogimage.org
Guide

og:locale: Set the Language of Your Open Graph Tags

og:locale declares the language and region of your page for social platforms. See the format, a table of common values, og:locale:alternate, and the Next.js code.

og:locale declares the language and the region of the text in your Open Graph tags. The format is language_TERRITORY.

<meta property="og:locale" content="en_US" />

The default is en_US. If your page is in American English, the tag is optional. If your page is in another language, set it.

The format

  • Two lowercase letters for the language, an underscore, and two uppercase letters for the region: de_DE, pt_BR.
  • Use an underscore, not a hyphen. The HTML lang attribute uses en-US. Open Graph uses en_US. This is the most frequent mistake.
  • Always include the region. en alone is not valid.

Common og:locale values

LanguageValue
English (United States)en_US
English (United Kingdom)en_GB
Germande_DE
Frenchfr_FR
Spanish (Spain)es_ES
Spanish (Latin America)es_LA
Portuguese (Brazil)pt_BR
Italianit_IT
Dutchnl_NL
Japaneseja_JP
Koreanko_KR
Chinese (Simplified)zh_CN

og:locale:alternate for translated pages

If the page exists in other languages, list them with og:locale:alternate. Use one tag for each language.

<meta property="og:locale" content="en_US" />
<meta property="og:locale:alternate" content="de_DE" />
<meta property="og:locale:alternate" content="fr_FR" />

og:locale and hreflang

They do different jobs. hreflang tells search engines which URL to show to a searcher in each language. og:locale tells social platforms the language of the preview text. A site with translations needs both.

og:locale in Next.js

export const metadata = {
  openGraph: {
    locale: 'en_US',
    alternateLocale: ['de_DE', 'fr_FR'],
  },
}

What happens when og:locale is missing

Platforms assume en_US. The preview still shows. For a page in German or Japanese, the wrong locale can affect how a platform formats and labels the share, so set the tag on each page that is not in American English.

Check a page with the Open Graph checker. Related: og:type, og:url, og:title, and the full list of Open Graph tags.