How to Fix Open Graph Tags in WordPress (Social Sharing)
When WordPress URLs are shared on Facebook, LinkedIn, WhatsApp or similar, the preview comes from Open Graph (OG) meta tags. Misconfigured OG tags produce poor previews: wrong image, missing title, no description — and lower click-through. This guide covers WordPress OG configuration via Yoast, Rank Math and AIOSEO plus manual control. Pair with OG generator guide and social previews.
Step 1: Audit current OG output
View source on 5 URLs. Check: og:title, og:description, og:image, og:url, og:type. If any missing or wrong, your social previews are suboptimal.
Step 2: Configure OG defaults in SEO plugin
Yoast → Social → Facebook. Rank Math → Titles & Meta → Social. AIOSEO → Social Networks. Set: default OG image (1200x630 PNG/JPG, under 1MB), default OG title pattern, default description pattern.
Step 3: Set per-post OG overrides
On individual posts, SEO plugin meta box has 'Social' or 'Open Graph' tab. Override: og:image (use a custom share image, not just the featured image), og:title (often punchier than SEO title), og:description (different from meta description, more shareable).
Step 4: Test with Facebook Sharing Debugger
developers.facebook.com/tools/debug → paste URL. Shows what Facebook sees. 'Scrape again' button refreshes Facebook's cache after you've made changes.
Step 5: Test with Twitter Card Validator
cards-dev.twitter.com/validator. Confirms Twitter card type is summary_large_image, image renders, title and description are correct. Twitter cards use OG tags as fallback but also support twitter:* specific tags.
Step 6: Configure LinkedIn previews
LinkedIn uses OG tags. Post Inspector (linkedin.com/post-inspector) shows what LinkedIn extracts. LinkedIn caches aggressively — 7 days. Refresh with the inspector after OG changes.
Step 7: Monitor and audit on plugin updates
OG output can regress on plugin updates. Periodically re-test 3-5 critical URLs in the Facebook Debugger. Add to monthly QA checklist.
Frequently Asked Questions
Why does Facebook show the wrong image after I updated OG?
Facebook caches OG data for ~30 days. Force refresh via Sharing Debugger: paste URL, click 'Scrape Again'. May take 2-3 scrapes to fully refresh. If still wrong, check that og:image URL is absolute (https://full-url) not relative, image is publicly accessible (not blocked by login), and image meets size requirements (200x200 minimum, 1200x630 recommended).
What size should OG images be in WordPress?
1200x630 pixels is the universal recommendation (works for Facebook, LinkedIn, WhatsApp, Twitter when no twitter:image set). Under 1MB file size. PNG or JPG (not WebP — limited preview support). Aspect ratio 1.91:1 prevents cropping.
Should I use the same image for og:image and twitter:image?
Usually yes — fewer images to maintain. Set og:image and let twitter:image inherit it via fallback. Override twitter:image only if you specifically want different art on Twitter (rare; not worth the maintenance overhead).
Why are WhatsApp link previews different from Facebook in WordPress?
WhatsApp uses OG tags but is more restrictive: requires image under 300KB, exact 1.91:1 aspect ratio, og:image must be in within the first ~4KB of HTML. WordPress with heavy header content sometimes fails this. Move OG tags to top of via theme template edit.
Do OG tags affect SEO ranking?
Not directly. OG tags affect social sharing CTR which affects referral traffic which can build authority signals over time. But the direct OG → ranking impact is zero. Configure OG for click-through and brand consistency, not ranking.
📤 Audit your OG tags
Find missing or broken Open Graph tags across your site.
Run OG Audit →