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.
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.
The Yoast SEO plugin makes it very easy to add Facebook’s Open Graph meta tags. This feature is enabled by default.
- Log in to your WordPress website.
When you’re logged in, you will be in your ‘Dashboard’.
- Click on ‘SEO’.
On the left-hand side, you will see a menu. In that menu, click on ‘SEO’.
- Click on ‘Social’.
The ‘SEO’ settings will expand providing you additional options. Click on ‘Social’.
- Click on the ‘Facebook’ tab.
- 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’.
- 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.
- 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.