WordPress powers a large share of the web, but it ships with zero Open Graph tags. A default install gives platforms nothing to scrape — your links get whatever random image and text the crawler happens to find. The fix is either one toggle in an SEO plugin or a small snippet in your theme, and this guide walks through both, including the featured-image trap that silently breaks the card.
Why WordPress Has No OG Tags by Default
Open Graph tags are a social-sharing protocol, not part of WordPress core. Core outputs the basics — document title, meta description, canonical — but nothing under the org.openengraph namespace. Media, news, and commerce themes often add it themselves, hence "some sites have it, mine doesn't". If your theme doesn't, you own the fix.
Option 1: SEO Plugin (Five-Minute Route)
If you already run Yoast SEO, Rank Math, or The SEO Framework, the OG output is one setting:
- Yoast SEO — SEO → Social → enable "Add Open Graph meta data".
- Rank Math — Titles & Meta → Social → toggle Open Graph.
- The SEO Framework — Social Meta → enable "Add Open Graph data".
Plugins then generate og:title, og:description, and og:image automatically from each post's SEO title, excerpt, and featured image. For most sites this is the correct answer: maintained, handles per-post overrides, and one less thing in your theme.
Option 2: Manual Snippet (Full Control)
If you'd rather not depend on a plugin, hook the tags into wp_head with a small snippet (child theme functions.php or an MU-plugin):
add_action("wp_head", function () {
$title = get_the_title();
$desc = get_the_excerpt();
$img = get_the_post_thumbnail_url(null, "large");
if (!$img) return; // no featured image: skip, don't guess
echo "<meta property="og:title" content="" . esc_attr($title) . "" />";
echo "<meta property="og:description" content="" . esc_attr($desc) . "" />";
echo "<meta property="og:image" content="" . esc_url($img) . "" />";
echo "<meta property="og:type" content="article" />";
});
Read the guard line: if the post has no featured image, the snippet outputs nothing rather than a broken or irrelevant card. That guard is the difference between a clean fallback and half-working shares.
The Featured Image Trap
The most common WordPress OG failure we see is invisible-to-you but visible to everyone who shares: the post looks fine, but the preview uses a tiny thumbnail or a random in-body image. It's almost always one of:
- No featured image set. Plugins then fall back to the first image in the content, which may be a logo or an ad.
- Featured image too small. WordPress thumbnails compress below platform minimums; use the "large" size or a custom 1200px crop.
- Image URL blocked. Hotlink protection or a caching plugin serving relative URLs — scrapers can't fetch a relative path.
The Cache Layer Nobody Checks First
WordPress sites almost always run a caching plugin, and that cache can serve scrapers a stale head. If your og:image is correct in a private window but not in the saved HTML, the page cache is the culprit — the fix is purging (and, if the crawler cache is sticky, busting the URL with a query parameter when testing). This is the classic "I fixed it but the preview didn't change" case, and it's worth checking before you touch any code.
Verify After Every Change
After enabling either option, check the rendered page's head for og:image with an absolute URL, then paste the post link into a chat or social app and look at the card. If the card is stale, append a cache-busting query parameter to the URL — most platforms cache per URL. For the recommended geometry, our OG image size guide covers 1200×630 and the safe band; if designing cards per post is the bottleneck, an OG image generator produces the artwork from your content automatically.