Skip to main content

Yoast SEO OpenGraph Tags: Functional specification

This documentation provides technical information about which OpenGraph and related tags that Yoast SEO generates and outputs.

We output a variety of OpenGraph and similar tags in the <head> of each page, in order to better inform data consumers about the content of the page in question. OpenGraph data is consumed by Facebook, but also by Pinterest, LinkedIn, WhatsApp and even Google.

OpenGraph metadata

Assuming that the respective admin settings are not disabled, these tags are output on all pages (except for error templates, which are described separately).

TagDescription
og:localeThe page's language and target territory, falling back to language only. E.g., en_US, or simply en.
og:typeThe type of page/resource.

website on the homepage.
profile on user profile pages.
article on all pages/posts and other templates.
og:titleThe title of the page.

Outputs a value based on the following hierarchy:
  • A user-defined "Facebook title" value for the page.
  • An auto-generated "Social title" from the template in Search Appearance.
  • A user-defined "SEO title" for the page.
  • An auto-generated "SEO title" from the template in Search Appearance.
  • The social title default option (same as the SEO title): %%title%% %%page%% %%sep%% %%sitename%%. For Author & Date archives the default is just the page title.
og:urlThe canonical URL of the page (or the series root, in the case of paginated content).
og:site_nameThe name of the site.

Conditional tags

The following tags are only output when their conditions are met:

TagDescriptionNotes
og:descriptionThe description of the page.Outputs a value based on the following hierarchy:
  • A user-defined "Facebook description" value for the page.
  • An auto-generated "Social description" from the template in Search Appearance.
  • A user-defined "Meta description" for the page.
  • An auto-generated "Meta description" from the template in Search Appearance.
  • A user-defined excerpt for the page (only for posts).
  • An auto-generated excerpt from the page's content (for terms: the term description).
article:publisherThe Facebook page URL of the publishing organization.Only populated when a value has been provided by the user.
Only populated on post and page types.
article:authorThe URL of the profile page of the author.Only populated when the user has a valid profile URL.
Only populated on post types.
article:modified_timeA timestamp of when the page was last modified.Only populated on post and page types.
article:published_timeA timestamp of when the page was published.Only populated on the post type. Use the wpseo_opengraph_show_publish_date filter to add additional posttypes.
og:imageThe URL of the primary image of the page.Only populated when the page contains a valid image, based on the following hierarchy:
  • A user-defined image "Facebook image" in the Social tab of the Yoast metabox.
  • A user-defined "Featured image" for the page (only for posts).
  • A prominent image from the page's content.
  • Yoast SEO WooCommerce only: Woo SEO adds one more image fallback: the first image in the Woo Product gallery.
  • The "Social default image" from the template in Search Appearance.
  • The site's fallback/default social image (set at SEO > Social > Facebook > Default image).
In case of an author archive, the image is based on the following hierarchy:
  • The "Social default image" from the template in Search Appearance.
  • The user's Gravatar image.
  • The site's fallback/default social image (set at SEO > Social > Facebook > Default image).
og:image:widthThe width in pixels of the og:image.Only populated when an og:image is set, and its width and height are known.
og:image:heightThe height in pixels of the og:image.Only populated when an og:image is set, and its width and height are known.

Additional conditional tags

Though not strictly open graph tags, these should be evaluated and output as part of this set of requirements.

TagDescriptionNotes
<meta name="author" content="%NAME%" />The name of the post authorOnly populated on post types.

Error templates

Only output the following tags are output:

TagValue
og:localeThe page's language and target territory, falling back to language only. E.g., en_US, or simply en.
og:titleThe site's error page title template value.
og:site_nameThe name of the site.

Deprecated tags

The following tags used to be output by Yoast SEO, but have been removed in recent updates.

TagDescriptionDeprecated
fb:adminsLegacy Facebook control. No longer appears to be supportedUnknown
article:sectionLegacy Facebook / Open Graph tag. No longer appears to be supported.Yoast SEO v14.0 (Apr 2020)
og:updated_timeLegacy Facebook / Open Graph tag. No longer appears to be supported.Yoast SEO v14.0 (Apr 2020)
og:image:secure_urlDefines a (separate) URL for the featured image, available over HTTPS. Unnecessarily duplicates the og:image tag when a site is on HTTPS, and, unnecessary/omitted when the site is not.Yoast SEO v14.0 (Apr 2020)
og:video:secure_urlLegacy Facebook / Open Graph tag. As per og:image:secure_url, but for the featured video (in our Video SEO for WordPress plugin).Yoast SEO v14.0 (Apr 2020)
og:image:typeDefines the image format. Poor value/performance trade-off; especially as we ping Facebook on post publish, at which point they determine and cache this information themselves.Yoast SEO v14.0 (Apr 2020)
fb:app_idThe Facebook App ID.Yoast SEO v15.5 (Dec 2020)