WordPress OG image: setting the social image, and the duplicate-tag trap
WordPress itself doesn't write Open Graph tags. Your SEO plugin does, and that's also where most broken previews come from.
Use one SEO plugin (Yoast SEO and Rank Math both do it) to output the Open Graph tags. Set a default social image in its settings and, per post, a social image or a featured image at 1200 × 630.
The most common bug is two sources printing og:image (a plugin plus the theme, or two plugins). Keep exactly one.
Where the image comes from
With an SEO plugin active, a post's og:image is usually chosen in this order: the social image set on that post in the plugin's box, then the featured image, then the plugin's default social image. Exact names differ by plugin; the order is similar.
Default image
- Yoast SEO: the site-wide social image is in Yoast's settings under site representation / social sharing; per post, use the Social tab in the Yoast box.
- Rank Math: a default Open Graph image in its general settings; per post, the Social tab in the Rank Math box.
Menus move between plugin versions; search the plugin's settings for "social" or "Open Graph image". Use 1200 × 630 (why).
The duplicate-tag trap
Themes and plugins such as Jetpack, social share plugins or a second SEO plugin can also print Open Graph tags. Then the page has two og:image tags and each platform picks one. Check with the link preview checker (it lists every tag) or view the page source and search for og:image. Turn off Open Graph output everywhere except one plugin.
Caching plugins
Page caches (WP Rocket, LiteSpeed, W3 Total Cache, your host's cache) can keep serving the old tags after you change the image. Clear the page cache, then re-scrape on each platform; see how to refresh each platform.
A default social image in 30 seconds
1200 × 630, your name, tagline and a screenshot. Free OG image.
Questions
Does WordPress add Open Graph tags by itself?
No. WordPress core doesn't output Open Graph tags; an SEO plugin like Yoast or Rank Math, or your theme, adds them.
Why does my WordPress post show the wrong image when shared?
Usually two plugins (or a plugin and the theme) print og:image, or a cache still serves the old tags. Keep one source of Open Graph tags, clear the cache and re-scrape.
What size should the WordPress featured image be for sharing?
1200 × 630 pixels works on every major platform.