WordPress OG Tags Not Working? How to Fix Social Preview Issues

WordPress showing wrong social preview images or missing og:image? Fix common issues with Yoast SEO, Rank Math, theme conflicts, and Facebook cache.

Why WordPress OG tags fail

WordPress does not output Open Graph tags by default. You need a plugin — typically Yoast SEO, Rank Math, or All in One SEO — to generate og:title, og:description, and og:image tags. If those tags are missing, duplicated, or outputting the wrong values, social platforms show broken previews.

Step 1: Verify OG tags are present

Right-click on your live page → View Page Source → search for og:image. If you don't see it, no OG plugin is active or it's misconfigured. If you see it twice, a theme or second plugin is adding duplicates.

Step 2: Configure your SEO plugin

Yoast SEO

  1. Go to SEO → Social in WordPress admin.
  2. Enable the Open Graph metadata toggle.
  3. Set a default OG image under SEO → Social → Facebook.
  4. For individual posts: edit the post → scroll to Yoast SEO meta box → click the Social tab → upload a custom OG image.
  5. If the image field is empty, Yoast falls back to the featured image. Set one.

Rank Math

  1. Go to Rank Math → General Settings → Links and ensure “Add Open Graph meta info” is enabled.
  2. Edit the post → open the Rank Math sidebar → click Social Preview to set a per-post OG image.
  3. Under Rank Math → Titles & Meta → Global Meta, set a fallback OG image for pages that don't have a featured image.

Step 3: Fix theme conflicts

Some WordPress themes (especially older ones) add their own og:image or og:title tags, causing duplicates that confuse crawlers. To check:

  1. Search your theme's functions.php or header template for og:. If found, remove the theme output and rely on your SEO plugin instead.
  2. Deactivate other plugins one at a time and re-check source if you see duplicate OG tags.

Step 4: Fix the OG image URL

  • Image must be absolute HTTPS: if your WordPress site recently moved to HTTPS, old images stored as HTTP URLs in the database will break OG crawlers. Use a plugin like Better Search Replace to update URLs.
  • Image must be publicly accessible: membership or login-gated images cannot be fetched by social crawlers.
  • Image dimensions: minimum 200×200 px; recommended 1200×630 px. Yoast and Rank Math warn you in the social preview section if the image is too small.

Step 5: Clear caches

  1. Clear your WordPress caching plugin (WP Rocket, W3 Total Cache, etc.).
  2. Clear your CDN cache (Cloudflare, Bunny, etc.).
  3. Clear the platform cache:
    • Facebook: use the Sharing Debugger and click “Scrape Again.”
    • LinkedIn: use the Post Inspector at linkedin.com/post-inspector.
    • Twitter: use the Card Validator at cards-dev.twitter.com/validator.

WordPress multisite and WooCommerce

  • Multisite: network-activate your SEO plugin so OG tags are output on every sub-site.
  • WooCommerce products: Yoast and Rank Math both support product-level OG images — set them in the product meta box. Use the product's main image as the OG image if no custom one is set.

Not sure which WordPress OG tag is broken? Paste your URL into OG Fixer to see the exact metadata your pages are outputting and what each social platform will display.