AddThis Academy

An ever-growing library of resources to help you become a better online marketer.

How to Add Open Graph Tags to Your WordPress Website

What are Open Graph tags?

Open graph meta tags allow you to control what content appears when a page of your website is shared on social media networks, like Facebook. It also controls what content appears for the previews of your pages in the AddThis Related Posts feed.

While AddThis does use Open Graph tags, it is important to have Open Graph tags on your website regardless of whether you use AddThis tools or not, since social networks use Open Graph tags to determine how to preview your website’s pages.

Here are the essential Open Graph tags that you should include in every page of your website:

og:title – This is the title or headline of the page.
Example: <meta property=”og:title” content=”My Page Title”/>

og:description – This is a 1-2 sentence snippet that summarizes the content of the page. Unlike a regular meta description tag, it won’t affect your SEO.
Example: <meta property=”og:description” content=”This description offers a preview of what this page is about.”/>

og:image – This is the URL of the image you want to appear with your content. Facebook recommends an image size of at least 1200 x 630 pixels, but smaller images will still be displayed. If you do not set an og:image, Facebook will try to guess what image should display for the page, which could lead to the wrong image or no image appearing.
Example: <meta property=”og:image” content=”https://www.mydomain.com/example-image.jpg”/>

og:url – This will determine which version of the URL will be shared and which share counts will display on your AddThis share buttons. For example, https://www.mydomain.com and http://mydomain.com/ are technically different URLs. Setting your og:url tag to https://www.mydomain.com ensures that version of the URL is always shared and the share count increases properly.
Example: <meta property=”og:url” content=”https://www.mydomain.com/example-page”/>

How to add Open Graph tags to a WordPress site

To add Open Graph tags to your WordPress website we recommend using a plugin that adds these tags to each page for you, like Yoast SEO or All in One SEO.

These and other SEO plugins will allow you to set the essential Open Graph tags for each page, usually in the “social” or “sharing” options of the plugin.

How to check if your Open Graph tags are correct

Once you have set your Open Graph tags, you can use Facebook’s Debugger to preview how your content will look when it’s shared and debug any issues. Just enter the URL of your page here and select “fetch new scrape information”.

Facebook is displaying the wrong Open Graph information

When a webpage is shared to Facebook, Facebook will scrape the URL to determine what information to preview for that page. Once the page has been scraped, Facebook will cache the information for 30 days, rather than checking for changes each time the URL is shared.

Therefore, if you update your Open Graph tags, Facebook won’t pick up the changes right away. You can force Facebook to rescrape the page using the Facebook Debugger. Just enter the URL of your page here and select “fetch new scrape information”.

Still have questions?

If you still have questions about adding Open Graph tags to your website pages, please contact our dedicated support team. We are happy to help!