WordPress Open Graph and Twitter Cards | SEO Forge
Download Log in
All Features: AI-Powered WordPress SEO

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. SEO 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 preview
  • og:description — the subtitle text
  • og:image — the image to show in the preview card
  • og:url — the canonical URL
  • og: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:title
  • twitter:description
  • twitter:image
  • twitter:site — your Twitter/X handle
  • twitter:creator — the author’s Twitter/X handle

SEO Forge outputs both sets of tags on every page automatically.


What gets generated

For every published post, SEO 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 automatically populated from the post’s metadata. You can override any of them in the SEO Forge meta box.


Per-post overrides

The SEO Forge meta box has a dedicated Social Preview section with fields for:

  • Custom OG titleoverrides the default (post title)
  • Custom OG descriptionoverrides the default (meta description)
  • Custom OG imageupload or select a specific image different from the featured image
  • Twitter-specific titleif you want a separate title for Twitter/X
  • Twitter-specific descriptionsame
  • Twitter-specific imagesame

Use these when the post title or featured image doesn’t make a great social card — for example, a technical article with a boring thumbnail where you’d rather upload a custom promotional image.


Visual preview

The SEO Forge meta box shows a live preview of how the post will appear when shared on:

  • Facebook / LinkedInthe standard large card format
  • Twitter/Xthe summary_large_image format
  • Slack / Discordthe inline unfurl format
  • iMessage / SMSthe compact card format

As you edit OG fields, the preview updates live. You see exactly what your share card will look like before publishing.


Fallback cascade

If a post doesn’t have a custom OG image and also doesn’t have a featured image, SEO Forge falls back to a Global Default OG Image set in plugin settings. The cascade is:

  1. Per-post custom OG image
  2. Post’s featured image
  3. Global default OG image (set in Settings)
  4. Empty (no image in the preview — not recommended)

Set a good global default OG image (your site logo on a branded background, typically) and every post has a social preview even without specific work.


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)

SEO Forge recommends 1200 × 630 as the default target, which works well across all major platforms. When you upload a custom OG image, the plugin warns you if the dimensions are likely to get cropped or distorted on specific platforms.


Product schema sync

For WooCommerce product pages, SEO Forge automatically sets og:type to product and populates product-specific OG fields (product:price:amount, product:price:currency, product:availability) from WooCommerce data. Facebook’s product-specific preview card then shows the price and stock status directly.


Debugging link previews

When a link preview looks wrong on Facebook, the cause is almost always stale cached data. Facebook’s Sharing Debugger (developers.facebook.com/tools/debug) lets you re-scrape the URL after updating OG tags. Twitter’s Card Validator does the same.

SEO Forge’s admin links to both tools directly from the meta box for quick debugging.


Ready to set up social previews?

Get SEO Forge — from $39/year →

Open Graph and Twitter Card output is included in every version of SEO Forge, including the free one.

Forge AI Assistant Online

Hi! I'm the SEO Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs