How to add Facebook’s OpenGraph​ meta tags

Facebook’s OpenGraph metadata allows users to share web pages on Facebook. If you add OpenGraph meta tags to your posts and pages, Facebook will display a preview with images and an excerpt when a link to your site is shared. In this article, we’ll explore how to add OpenGraph meta tags to your site.

Related articles

The Yoast SEO plugin makes it very easy to add Facebook’s Open Graph meta tags. This feature is enabled by default.

  1. Log in to your WordPress website.

    When you’re logged in, you will be in your ‘Dashboard’.

  2. Click on ‘SEO’.

    On the left-hand side, you will see a menu. In that menu, click on ‘SEO’.

  3. Click on ‘Social’.

    The ‘SEO’ settings will expand providing you additional options. Click on ‘Social’.

  4. Click on the ‘Facebook’ tab.

  5. Toggle the ‘Add Open Graph meta data’ switch. 

    To enable the feature, toggle the switch to ‘On’.
    To disable the feature, toggle the switch to ‘Off’.
    toggle open graph

  6. Customize your Open Graph tags.

    Customize your Open Graph tags by adding a default image for pages without images. If you have a non-static homepage, you can set the homepage Open Graph tags here, as well.

  7. Click ‘Save Changes’.

How to edit OpenGraph tags on your post/page

If you want to edit the OpenGraph tags on your post or page, follow the steps in this article on how to set custom Facebook OpenGraph tags.

What are those article and time meta tags?

When you enable OpenGraph, Yoast will output some specific meta tags below. These tags are used by Facebook.

<meta property="article:published_time" content="date_time_goes_here" />
<meta property="article:modified_time" content="date_time_goes_here" />
<meta property="og:updated_time" content="date_time_goes_here" />

Note: If you are seeing dates in search engines it is coming from elsewhere. Please use this guide: Date appears in search results.