WordPress does not print Open Graph tags on its own. Share cards come from an SEO plugin, your theme, or a small code snippet. Blank boxes and tiny crops almost always mean no tag, the wrong tag, duplicate tags, or a cached old card. This guide covers the full tag set—title, description, and image—not only the PNG.
How Open Graph works on WordPress
Browsers render your theme. Social crawlers read the HTML in the response—usually whatever your SEO plugin injects into <head>. JavaScript that rewrites the DOM after load does not help most crawlers. Your job is to make sure the first HTML response contains one clear set of tags.
Useful companion tools while you set this up:
- OG Image Generator — create a 1200×630 card
- Image Resizer — crop an existing asset to the right size
- Social Image Checker — sanity-check the file before upload
- Meta Tag Generator — compare a clean snippet to plugin output
- Link Preview Checker — verify the live URL after publish
Reliable workflow (four steps)
- Create the image. Prefer 1200×630 PNG (graphics) or JPG (photos). Keep text inside the safe area. See OG image size.
- Upload the original. Media Library → copy the full-size file URL, not a
-300x200derivative. - Assign it in one place. Yoast or Rank Math social image fields (below), or the snippet at the end if you have no SEO plugin.
- Verify. View Source → search
og:image→ exactly one absolutehttps://tag → run the Link Preview Checker.
Which Open Graph tags WordPress should emit
For a usable share card, the first HTML response should include at least:
| Tag | Role |
|---|---|
og:title |
Headline on the card (often from the SEO title or post title) |
og:description |
Supporting line under the title |
og:image |
Absolute https:// URL to a ~1200×630 PNG or JPG |
og:url |
Canonical page URL the crawler should treat as the share target |
og:type |
Usually article for posts, website for the homepage |
twitter:card |
Prefer summary_large_image when you want a large image on X |
Yoast and Rank Math fill most of these when Social / Open Graph output is enabled. Your job is to set accurate copy and a dedicated social image, then verify in View Source—not in the plugin preview alone. Use the Meta Tag Generator to compare a clean snippet, and the OG Tags Repair Assistant if an image URL is relative or still on http://.
Yoast SEO
- Edit the post or page.
- Confirm the SEO title and meta description (these often feed
og:title/og:descriptionunless you override Social fields). - Open the Yoast SEO panel → Social (wording varies by version).
- Set Facebook / Open Graph title and description if you need share-specific copy that differs from the SERP snippet.
- Set the Facebook / Open Graph image to your 1200×630 file.
- Optionally set a site-wide default social image under Yoast’s social settings for posts that have none.
If the social image field is empty, Yoast generally falls back to the featured image. Featured images are often cropped for the theme, not for a 1.91:1 share card—set the social image explicitly when the card matters.
Rank Math
- Open the Rank Math meta box on the post screen.
- Review the title and description Rank Math will use for search; adjust Social tab overrides when the share card needs different wording.
- Open the Social tab.
- Set the Facebook (Open Graph) image.
- Set the Twitter/X image only if you want a different crop.
- Configure a global default social image in Rank Math’s titles & meta / social settings if you want a fallback.
As with Yoast, confirm the live tags; do not assume the featured image always wins.
Why the WordPress OG image is missing or wrong
Work through these in order:
- Multiple tag sources. Count
og:imagein View Source. Disable theme “social sharing” or Jetpack Publicize Open Graph if your SEO plugin already owns tags. - Relative or protected URL. The image must open logged-out. CDN signed URLs that expire break crawlers.
- Page cache / CDN HTML. Purge after changing social fields, then View Source again.
- Security plugins blocking bots. Allow Facebook, LinkedIn, and WhatsApp crawlers for the page and the media file. See SocialImageKitBot for how our checker identifies itself when you test.
- Maintenance / coming-soon plugins returning a gate to anonymous clients.
- Wrong file. Tiny featured crops, multi‑MB originals, or WebP-only. Prefer 1200×630 PNG/JPG well under 1 MB (tighter for WhatsApp—see Facebook vs WhatsApp).
- Stale platform cache. After HTML is correct, use a new file name if needed, then re-scrape via the Facebook Sharing Debugger or LinkedIn Post Inspector landings.
For the platform-agnostic checklist, read why your og:image is not showing.
No SEO plugin? Minimal snippet
Add this in a small custom plugin or a child theme functions.php. It reads a custom field og_image_url and prints tags on singular posts and pages. Back up first. Do not combine this with Yoast/Rank Math Open Graph output.
add_action( 'wp_head', function () {
if ( ! is_singular() ) {
return;
}
$image = get_post_meta( get_the_ID(), 'og_image_url', true );
if ( ! $image ) {
return;
}
echo '<meta property="og:image" content="' . esc_url( $image ) . '" />' . "\n";
echo '<meta property="og:image:width" content="1200" />' . "\n";
echo '<meta property="og:image:height" content="630" />' . "\n";
echo '<meta name="twitter:card" content="summary_large_image" />' . "\n";
} );
Extend the snippet with escaped og:title, og:description, and og:url if you have no SEO plugin. Prefer a maintained SEO plugin for most sites so you do not reinvent sanitization and conflict handling. For a local plugin that only manages OG meta, see the optional SocialImageKit WordPress plugin in this repository’s wordpress-plugin/ folder (not auto-installed on Hostinger).
Multisite, custom post types, and page builders
On WordPress Multisite, confirm you edited the site that actually serves the public URL. Network-activated SEO plugins can override per-site social defaults. For custom post types, open Rank Math or Yoast settings for that type and ensure Open Graph output is enabled—some setups only attach social fields to posts and pages.
Page builders sometimes inject a second head section or duplicate meta tags when a social share module sits beside your SEO plugin. After publishing from a builder, always re-check View Source on the live permalink, not the builder preview iframe.
If your media library offloads files to S3 or a CDN with signed URLs, make sure the URL written into og:image is a stable public object URL. Short-lived signed links expire for crawlers even when they still work in your browser. After any media offload change, open the image URL in a private window and confirm it still returns the file without signing in or waiting on a temporary token.
Checklist before you share
- One
og:imagein View Source, absolutehttps:// - Full-size Media Library URL (not a thumbnail derivative)
- Image opens privately; about 1200 by 630 pixels; reasonable file weight
- Page cache and CDN purged after the change
- Crawlers allowed through security plugins
- Platform re-scrape completed after the HTML is correct
- Custom post type and builder duplicates ruled out
Browse OG image examples for good versus weak cards, and keep the OG tags cheat sheet nearby when auditing head tags.
Frequently asked questions
Short answers from this guide.
Does the WordPress featured image become the og:image?
Not by itself. Core WordPress does not output Open Graph. Yoast and Rank Math often fall back to the featured image when no social image is set, but themes and settings can change that. Always verify the live HTML.
What size should a WordPress OG image be?
Use 1200×630 pixels as the default. Upload the full-size file and reference its original Media Library URL, not a resized medium or thumbnail path.
Why does my WordPress share image still show the old picture?
Platforms cache the first scrape, and page-cache plugins can serve old HTML. Purge WordPress/CDN caches, change the image file name if the picture is stuck, then re-scrape in Facebook Sharing Debugger or LinkedIn Post Inspector.
Can two plugins break my OG image?
Yes. If a theme, SEO plugin, Jetpack, and a social plugin each print og:image, crawlers may pick the wrong one. Keep a single source and count the tags in View Source.
Should I use WebP for WordPress og:image?
Prefer PNG or JPG for the tagged file. WebP support across social crawlers is inconsistent even when your theme serves WebP to browsers.
Do I need a separate Twitter/X image in Yoast or Rank Math?
Optional. Many sites reuse the Open Graph image. If you set a Twitter field, keep twitter:card as summary_large_image when you want a large card.