There are many ways to set Open Graph Tags in WordPress, but following is a list of some of the popular plugin options that help in setting Open Graph tags in a WordPress website.
Set Open Graph Tags in Yoast WordPress SEO Plugin
The Yoast SEO Plugin is the most popular SEO plugin for WordPress. It has Open Graph protocols built in, so it’s an all-one-solution.
Once the plugin is installed and activated, you need to tell it to add Open Graph Metadata. To set your Open Graph tags, do this:
- Go to “SEO” in the left column of the WordPress dashboard
- Select “Social” from the list under “SEO”
- Click on the Facebook Tab and check the box next to “Add Open Graph meta data”
- Click the “Save Changes” button
Once Open Graph is activated, the Yoast SEO plugin will create your Open Graph tags for you based on your SEO title and description for a particular page or post.
By default, it will use the ‘Featured Image’ for the Open Graph image, so be sure you have set a Featured Image.
If you want to use slightly different wording or a specific image that is different from your Featured Image or meta description, you can override the defaults from the edit screen for a particular post or page.. To do this, scroll down to the “Yoast SEO” box and click on the “Social” tab icon (shown below).
In this screen, upload the image you want to use in the Facebook Image field (screenshot below). The current optimal size for a Facebook Open Graph Share image is 1230px X 630px. Refer to the Facebook Best Practices page to review if that size has changed.
Set Open Graph Tags in “Facebook Open Graph, Google+ and Twitter Card Tags” Plugin
If you are having issues with the Open Graph protocols working in Yoast WordPress SEO plugin, then try the Facebook Open Graph, Google+ and Twitter Card Tags. We have previously used this plugin in conjunction with Yoast SEO with no problems.
When you install it, the plugin will walk you through how to use it with Yoast WordPress SEO, or you can use it on its own.