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
langattribute usesen-US. Open Graph usesen_US. This is the most frequent mistake. - Always include the region.
enalone is not valid.
Common og:locale values
| Language | Value |
|---|---|
| English (United States) | en_US |
| English (United Kingdom) | en_GB |
| German | de_DE |
| French | fr_FR |
| Spanish (Spain) | es_ES |
| Spanish (Latin America) | es_LA |
| Portuguese (Brazil) | pt_BR |
| Italian | it_IT |
| Dutch | nl_NL |
| Japanese | ja_JP |
| Korean | ko_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.