How to set an OG image in WordPress

Last updated September 21, 2026 · Reviewed by Sumera Yaqoob

WordPress will not emit a usable og:image just because you set a featured image. The featured image is for the theme. Social tags usually come from an SEO plugin, a header snippet, or a custom field.

How do I set an OG image in WordPress?

Upload a 1200×630 PNG or JPG to the Media Library, copy the full https attachment URL, and paste it into Yoast SEO or Rank Math’s social / Open Graph image field for that post. Then open the live URL, use View Source, and confirm a single absolute og:image tag. Do not trust the block editor preview alone.

What size should the WordPress social image be?

Use the same Open Graph default as other sites: 1200×630. Avoid “medium” or thumbnail sizes from the media library. Create the file in the OG Image Generator, upload the export, and reference that attachment URL.

Step Where
Export 1200×630 OG Image Generator
Upload Media Library
Assign Yoast / Rank Math social tab (or one header snippet)
Verify View Source + Link Preview Checker
Rescrape Facebook / LinkedIn debuggers

Common WordPress mistakes

  1. Two plugins both printing Open Graph — crawlers may pick a 300px thumbnail.
  2. Page builders injecting meta tags only in JavaScript — bots never see them.
  3. Relative URLs or CDN paths that require signed cookies.
  4. Same filename after a redesign — caches keep the old card until you rescrape or change the path.

Full missing-preview checklist: Why your og:image is not showing.

Last updated: September 21, 2026