Skip to content
PressQueue

How to add Open Graph tags to WordPress

Updated · 3 min read

PressQueue is a free WordPress plugin that shares your posts through Buffer. See how it works

When someone shares a WordPress page on a social network, the network reads information in the page’s code to build a preview with a title, description, and image. Open Graph tags are metadata in the page’s HTML head, which stores page details separately from the text readers see.

First check whether your site already outputs these tags. If it does, adjust the existing source instead of adding a second one, which can create conflicting previews. PressQueue offers another way to manage share images and Open Graph output while sharing WordPress posts through Buffer.

Check for existing Open Graph tags

Open a published page, choose View Page Source in your browser, and search for og:title or og:image. These tags give the social network the page title and its preview image. The Open Graph protocol also defines og:type, which describes the content, and og:url, the preferred address for the page. A description and site name provide useful additional context, as outlined in the Open Graph protocol.

If the tags are present, check that they describe the page correctly. A featured image in the WordPress editor does not by itself confirm that the page’s HTML contains the right og:image value. WordPress.com adds social-preview metadata automatically, while plugins such as Yoast SEO, Rank Math, AIOSEO, and Jetpack can also produce it under their documented conditions. Inspect the actual page output before changing settings.

When more than one source generates Open Graph tags, choose one source to manage them. Conflicting sources can produce the wrong title, description, or image; Yoast’s guidance recommends avoiding duplicate output.

Choose a clear sharing image

Use a dedicated image that remains legible when a social network crops or resizes it. WordPress.com recommends 1200 × 630 pixels as a cross-network starting point, with important content centered and the file under 5 MB. These are practical recommendations, not requirements in the Open Graph protocol. LinkedIn, for example, documents its own image requirements for shared webpages in its website-sharing guidance.

Set a page-specific image when the post needs one. If you use a sitewide fallback, or default image, confirm that it appears only when the page has no specific image. Then inspect the published page’s source and confirm that og:image points to the intended image address.

Add Open Graph images with PressQueue

PressQueue is a free, open-source WordPress plugin that shares posts to social media through Buffer. Its social images can also provide the page’s og:image and twitter:image values, so the image appears in link previews. PressQueue works with Yoast SEO, Rank Math, The SEO Framework, and Jetpack; if no SEO plugin is active, PressQueue prints the tags itself. If you set an image for a post in an SEO plugin, PressQueue uses that image instead.

To set it up:

  1. Download pressqueue.zip from the PressQueue download page. In WordPress, go to Plugins > Add Plugin > Upload Plugin and upload the ZIP.
  2. In PressQueue, open Settings > Social images. Select a background or your own image. Choose the font and text color. Set the alignment and site name. The plugin draws an image with the post title and site name in a wide format suited to link previews.
  3. Choose whether to use those images for every post. You can limit them to posts without their own image, or turn them off. Publish a test post and inspect its page source and social preview.

PressQueue creates an image the first time a post needs one, redraws it if the title or image style changes, and keeps it out of the WordPress Media Library. It requires the PHP GD image library with FreeType font support. Without it, posts go out with text and a link, but no generated image. PressQueue also requires a WordPress site that allows plugin uploads and a Buffer account with social accounts added. See the PressQueue documentation for setup details.

Test the published page

After saving changes, inspect the public page source again. Confirm that the title, image, and URL tags in the source match the page. Check that visitors who are not logged in can load the image URL. If you see an old preview, clear the site or server cache, then use the social network’s inspection tool to ask it to fetch the page again. WordPress.com describes inspection steps for Facebook and LinkedIn in its social-preview support guide.

A preview inside WordPress can help while editing, but the published page is what a social network fetches. If the external preview remains wrong, check for duplicate tags, a blocked page or image, and an earlier saved copy of the page information.

More about link previews and social images