OpenGraph Tags - Functional specification

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

We output a variety of OpenGraph tags in the <head> of each page, in order to better inform data consumers about the content of the page in question. OpenGraph 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.
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.
og:urlThe canonical URL of the page.
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.
  • A user-defined meta description (or template) for the page.
  • A user-defined excerpt for the page.
  • An auto-generated excerpt from the page's content.
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 post and page types.
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 (for a specific platform).
  • A 'featured' image.
  • A prominent image from the page's content.
  • n the case of the profile template, the user's Gravatar image.
  • The site's fallback/default social 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.

Error templates

Only output the following tags are output:

TagValue
og:localeThe page's language.
og:titleThe site's error title template.
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.

TagDescriptionReasonDeprecation
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)