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.
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:
- 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.
- Enter a custom image, title and description under Frontpage settings.
- Click ‘Save Changes’.
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.
- Edit the post or page in WordPress.
- Scroll down and click the ‘Social’ icon in the Yoast meta box.
- Click on the ‘Facebook’ tab in the Yoast meta box.
- 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.