WordPress Open Graph and Twitter Cards — Social Preview
When someone shares your WordPress post on Facebook, LinkedIn, X (Twitter), Slack, Discord, or any other platform that generates a link preview, the preview is built from Open Graph and Twitter Card meta tags in your HTML head. Rank Forge outputs all of these automatically — title, description, image, type, URL — with per-post overrides and a global fallback image.
What Open Graph does
Open Graph (OG) is a meta tag protocol created by Facebook in 2010 and now used by basically every social platform. The OG tags on a page tell link-preview crawlers:
og:title— the headline for the previewog:description— the subtitle textog:image— the image to show in the preview cardog:url— the canonical URLog:type— the content type (article, website, product, etc.)og:site_name— the site the content lives on
Twitter Cards are a parallel protocol from Twitter with similar but distinct tags:
twitter:card— card type (summary, summary_large_image, player, app)twitter:titletwitter:descriptiontwitter:image
Rank Forge writes twitter:card (summary_large_image when the page has an image, summary when it has none), twitter:title, twitter:description and twitter:image. It does not write twitter:site or twitter:creator. It writes both sets of tags on single posts and pages, the home page, category, tag and other archives, author and date archives, and search and 404 pages, and not on attachment pages or in feeds.
What gets generated
For every published post, Rank Forge outputs:
<meta property="og:title" content="Your Post Title" />
<meta property="og:description" content="Your post excerpt or meta description..." />
<meta property="og:image" content="https://yoursite.com/wp-content/uploads/featured.jpg" />
<meta property="og:url" content="https://yoursite.com/your-post/" />
<meta property="og:type" content="article" />
<meta property="og:site_name" content="Your Site Name" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Your Post Title" />
<meta name="twitter:description" content="Your post excerpt or meta description..." />
<meta name="twitter:image" content="https://yoursite.com/wp-content/uploads/featured.jpg" />
Each tag is filled in from the post. In the Rank Forge box you can override the titles, the descriptions and the image (see Per-post overrides below); the URL, the type and the site name are not changed there.
Per-post overrides
The Rank Forge meta box has a Social tab with these sections:
- Facebook / Open Graphthe og:title override and og:description override fields. Leave them empty to reuse the SEO title and description
- X (Twitter) Cardthe twitter:title override and twitter:description override fields. Leave them empty to reuse the OG or SEO values
- Social Media Imageselect an image for this post. It overrides the featured image and the site default
Use these when the post title or featured image does not make a good social card, for example a technical article with a plain thumbnail where you want a custom promotional image.
Visual preview
The Social tab ends with a Social Preview (OG / Twitter) card. It shows the social image, the SEO title and the meta description saved in the box (or the post title and the opening words of the post). The og: and twitter: overrides do not show in it. The image changes as soon as you select a new Social Media Image.
Fallback cascade
Rank Forge uses the first image it finds, in this order. For a post or a page:
- The Social Media Image of the post (chosen in the Rank Forge box; when that image is gone, the address saved with it)
- The featured image of the post
- Default Social Image (Rank Forge > Settings, tab Social)
- No image: no
og:imagetag is written, and the Twitter card is a summary without an image
For a WooCommerce product, the WooCommerce placeholder image comes in before the Default Social Image:
- The Social Media Image of the product
- The product image (its featured image)
- The WooCommerce placeholder image
- Default Social Image (Rank Forge > Settings, tab Social)
Because the placeholder comes first, a product without an image shows the placeholder and not your default. The home page, the archives and the search and 404 pages have no image of their own and use the Default Social Image.
A default social image (for example your logo on a branded background) gives a post without an image of its own one to show.
Optimal image dimensions
Different platforms prefer different image sizes:
- Facebook / LinkedIn1200 × 630 pixels (1.91:1 aspect ratio)
- Twitter/X large image1200 × 630 pixels
- Twitter/X summary144 × 144 pixels
- Pinteresttaller images rank better (1000 × 1500 or similar)
Under the preview of the image you choose in the Social Media Image field, the box shows the note Recommended size: 1200×630 px. Rank Forge does not check the size of the image.
Product schema sync
For WooCommerce product pages, Rank Forge automatically sets og:type to product and populates product-specific OG fields (product:price:amount, product:price:currency, product:availability) from WooCommerce data. Whether a platform shows them in its preview is up to the platform.
Debugging link previews
If a link preview looks wrong on Facebook, check the tags in the source of the page. Facebook’s Sharing Debugger (developers.facebook.com/tools/debug) lets you re-scrape the URL after you update the OG tags.
Ready to set up social previews?
Open Graph and Twitter Card output is included in every version of Rank Forge, including the free one.