How to set custom Facebook OpenGraph tags

Yoast SEO includes the option to set custom Facebook images, titles and descriptions on a page by page basis. In this article, we’ll explain how to set custom Facebook OpenGraph tags.

In Yoast SEO Premium, you get full control of your Facebook and Twitter shares! There is no guesswork with the social preview feature. By seeing exactly what your posts look like when you share them, you get the chance to improve your social media presence.

Related articles

Check your WordPress homepage type

Setting custom Facebook OpenGraph tags depends on the homepage type of your WordPress site. WordPress has two options for your homepage: ‘Your latest posts’ or ‘Static’. You can check your WordPress site’s homepage type by following the steps in this article about WordPress homepage types.

Homepage displays your latest posts

If your homepage displays your latest posts, you can follow these steps to set custom Facebook OpenGraph tags:

  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’.
    Admin SEO Social
  4. Click on the Facebook tab.

  5. Enter a custom image, title and description under Frontpage settings.

  6. Click ‘Save Changes’.

Static homepage

If you have a static homepage for your WordPress site, you can set a custom image, title, and description for each post, page (including the static front and blog pages) or taxonomy.

To set custom OpenGraph tags for a post, page or taxonomy, follow the steps below.

  1. Edit the post or page in WordPress.

  2. Scroll down and click the ‘Social’ icon in the Yoast meta box.

  3. Click on the ‘Facebook’ tab in the Yoast meta box.

  4. Set a custom image, title and description.

    One of the Yoast SEO for WordPress Premium features is the ability to see what your post will look like when sharing on Facebook.

There are a number of filters documented in the plugin code for developers to programmatically change OpenGraph output. Here are some examples.