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.
de_DE, pt_BR.lang attribute uses en-US. Open Graph uses en_US. This is the most frequent mistake.en alone is not valid.| 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 |
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" />
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.
export const metadata = {
openGraph: {
locale: 'en_US',
alternateLocale: ['de_DE', 'fr_FR'],
},
}
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.