WordPress

What Image Does WordPress Show on Preview?

WordPress core prints no og:image tag. Your SEO plugin picks the preview image: Social tab image, then featured image, then content image, then default.

Shashank Dubey
·12 min read
Link preview fallback order in WordPress: Social tab image, featured image, first content image, site default, beside a 1200 x 630 shared link card

WordPress itself does not choose a preview image for Facebook, LinkedIn, X, Slack or WhatsApp. Core prints no og:image or twitter:image tag at all, so the picture in a link preview comes from whatever plugin or theme writes those tags. On most sites that is an SEO plugin, and it picks the image in a fixed order: the image you set in its Social tab, then the featured image, then an image found in the post content, then a site-wide default.

So the practical answer is short. Set a featured image of at least 1200 x 630 pixels, make sure exactly one plugin prints the Open Graph tags, and re-scrape the URL in each platform’s debugger after you change anything. The rest of this guide shows what each part of that chain does, where it breaks, and how to check it yourself.

Our team checked every claim below against the platform docs and the WordPress 7.1 core source on 18 November 2026. This page had no recorded Search Console queries when we refreshed it, so the headings follow the questions people ask when a shared link shows the wrong picture.

Does WordPress core add a preview image to shared links?

No. We read through the wp_head actions registered in wp-includes/default-filters.php on WordPress 7.1.2. Core prints the title tag, robots meta, canonical link, feed links, the shortlink, the site icon and oEmbed discovery links. There is no Open Graph output and no X (Twitter) card output anywhere in the front end.

That surprises people, because a fresh WordPress site often does show an image when shared. The usual reasons:

  • An SEO plugin such as Yoast SEO, Rank Math, All in One SEO or SEOPress is active, and its social features are on by default.
  • Jetpack is connected with its Sharing or Jetpack Social module turned on. Jetpack then adds Open Graph tags to each post, and it switches them off by itself when another plugin already handles them (Jetpack’s note on this).
  • The theme prints its own tags. Some commercial themes do this, which is a common source of duplicate tags.
  • No tag exists and the platform guesses. Facebook’s crawler, Slack and messaging apps will try to infer an image from the page when no tag is present, and the guess is often the logo or the first large image in the HTML.

There is one place where core does pick an image: oEmbed. When someone pastes your post URL into another WordPress site, that site asks yours for an oEmbed response. Core’s get_oembed_response_data_rich() function (hooked to oembed_response_data in default-filters.php) adds a thumbnail_url only if the post has a featured image. No featured image, no thumbnail in the embed card.

Which image does an SEO plugin put in the preview?

Every major SEO plugin follows the same basic idea: an image you set on purpose wins, and automatic guesses come after. The details differ, and those differences explain most “wrong image” reports.

Yoast SEO

Yoast documents its order in its Open Graph functional specification. For a post it uses, in this order:

  1. The Facebook image set in the Social tab of the Yoast box on that post.
  2. The featured image.
  3. A prominent image from the content (the full-size version if the content uses a resized copy).
  4. With Yoast WooCommerce SEO only, the first image in the product gallery.
  5. The social default image from the post type template.
  6. The site-wide default image.

For X, Yoast prints twitter:image only when you set an X image that differs from the Facebook one. Otherwise it leaves the tag out on purpose, because X falls back to og:image anyway (Yoast X specification). If you view source and find no twitter:image, that is normal.

Rank Math

Rank Math’s Titles and Meta documentation says the “OpenGraph Thumbnail” you set under Global Meta is a fallback “if your post does not have a featured image / OpenGraph image set”. Its developer hooks show the other step in between: it also takes an image from the content, and the rank_math/opengraph/pre_set_content_image filter exists to turn that off (Rank Math filters and hooks). So the order is the per-post Social image, the featured image, an image from the content, then the default thumbnail. Rank Math recommends 1200 x 630 for that default.

All in One SEO

AIOSEO makes the source a setting. Under Social Networks, Facebook tab, the “Default Post Image Source” dropdown offers Default Image, Featured Image, Attached Image, First Image in Content, Image from Custom Field, Post Author Image and First Available Image. When the chosen source has nothing, it uses the default post Facebook image, and if your theme supports a logo it uses that logo as the default (AIOSEO docs). That last detail is why some AIOSEO sites share every post with the site logo.

Quick comparison

Plugin

First choice

Then

Last resort

Yoast SEO

Social tab image on the post

Featured image, then an image in the content

Post type default, then site default

Rank Math

Social tab image on the post

Featured image, then an image in the content

OpenGraph Thumbnail in Global Meta

All in One SEO

Social tab image on the post

Whatever “Default Post Image Source” says

Default Facebook image or theme logo

Jetpack (no SEO plugin)

Jetpack’s own pick from the post

Order not documented

Not documented

Nothing active

No tag at all

Platform guesses from the HTML

Often the logo or no image

If you want one rule that works with all of them: always set a featured image. It is the second choice everywhere, and it is the only image that also feeds core’s oEmbed cards.

What size should the preview image be for each platform?

A 1200 x 630 pixel image under 5 MB works on every platform we checked. Here is what each one actually documents, read on 18 November 2026:

Platform

Tag it reads

Documented size

File limits

Facebook

og:image

At least 1200 x 630 recommended; 600 x 315 for the large card; 200 x 200 absolute minimum; aim for 1.91:1

8 MB

LinkedIn

og:image

Minimum 1200 x 627, ratio 1.91:1; under 401 px wide shows as a small thumbnail

5 MB

X (large card)

twitter:image, then og:image

Ratio 2:1, from 300 x 157 up to 4096 x 4096

Under 5 MB; JPG, PNG, WEBP, GIF; no SVG

Slack

oEmbed, then card and Open Graph tags

No size published

Not published

Google Search and Discover

og:image or schema.org primaryImageOfPage, as a hint

High resolution; avoid extreme ratios

Not published

Sources: Meta image guidelines, LinkedIn help on shared URLs, Slack’s robot page, Google image SEO best practices. X no longer hosts its cards documentation on the current developer site; the figures above come from the last published versions of its cards markup reference and large image card page (archived May 2025).

Two details from those pages matter more than the pixel counts:

  • Facebook says to add og:image:width and og:image:height so its crawler can render the image on the very first share. Without them, the first person to share a new post often sees no image, because the crawler has not processed it yet. Yoast prints both tags when it knows the dimensions.
  • Google’s guidance for the preferred image says to avoid a generic image such as your site logo, and to avoid an image with text in it. That is the opposite of many social cards. If Google thumbnails matter to you, keep text on the card light and make sure the main subject still reads without it.

Format is the other trap. Facebook’s image page does not list formats, X lists WEBP as supported, and LinkedIn does not say. JPG or PNG is the safe choice for the social image even if the rest of your site serves WebP or AVIF.

How do I see which image my post is sending right now?

Look at what the crawler sees, not what your browser shows. Page caches, lazy-load plugins and CDNs can all change the HTML, so test the live URL as the platform’s bot would.

# Checked on 18 Nov 2026. Shows every social image tag the page sends.
curl -s -A "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)" \
  https://example.com/your-post/ | grep -iE 'og:image|twitter:(card|image)|rel="canonical"'

The user agent string is the one Facebook documents for its web crawler. Read the output with three questions in mind:

  1. Is there exactly one og:image? Two different values usually mean a theme and a plugin, or two plugins, are both printing tags.
  2. Does the URL open in a private browser window? If it returns 403 or redirects to a login page, no platform can fetch it.
  3. Does the canonical URL point to this post? Facebook treats og:url as the page’s canonical address, and SEO plugins fill it from the canonical. In one support thread we cite below, a wrong canonical made Facebook show another page’s image and text.

If you want to confirm which featured image WordPress has stored, WP-CLI reads it straight from post meta:

# Checked on 18 Nov 2026 with WP-CLI 2.x
wp post meta get 123 _thumbnail_id      # attachment ID of the featured image
wp post get 456 --field=guid            # replace 456 with that ID to see the file

The featured image is stored as the _thumbnail_id row in wp_postmeta, pointing at an attachment post. Our guide on where WordPress stores image data in the database walks through those tables if you need to fix it by query.

Why does Facebook still show the old image after I changed it?

Because Facebook caches what it scraped. Meta’s image guidelines say images are cached by URL, and changing an image does not update previews of posts that were already shared. The fix has two parts.

  1. Upload the new image as a new file with a new file name. Replacing the file at the same URL keeps the old cached copy alive on Facebook’s side and on any CDN in front of your site.
  2. Open the Sharing Debugger, paste the post URL and click “Scrape Again”. New shares will use the new image. Old shares keep the old one.

LinkedIn works the same way through its Post Inspector: inspecting a URL makes LinkedIn fetch it again for new posts. X no longer documents a card validator on its current developer site, so the preview inside the post composer is the practical check. We found no public refresh tool for Slack or WhatsApp; the usual workaround is sharing a slightly different URL (for example with a harmless query string such as ?v=2) so the app fetches it fresh.

Your own caches can hold the old tag too. If you changed the image in the editor but the curl test above still shows the old URL, purge the page cache and the CDN first. Our breakdown of WordPress caching layers covers which layer to clear, and the CDN setup guide explains how edge caching interacts with changed files.

Why does the preview show my logo or a random image?

Almost always, there was no image the plugin was told to use, so it fell back. Work down this list:

  • No featured image. The plugin moves on to “an image in the content”, which may be a sidebar ad, an author photo or a banner placed early in the post.
  • A site default or theme logo is set. AIOSEO uses the theme logo as its default Facebook image when the theme supports one. Yoast and Rank Math use whatever you put in their default fields.
  • The content image is too small. Plugins can reject images below their minimum size and keep looking, which can land on an image far down the page.
  • No Open Graph tags at all. With no tags, Facebook infers an image from the page, and Meta’s debugger will warn that the property “should be explicitly provided”.
  • Robots or a firewall block the crawler. If facebookexternalhit, LinkedInBot or Slackbot-LinkExpanding gets a 403, the platform shows a bare link. Check security plugin rate limits and any bot rules in your robots.txt file.

Can I set the preview image without an SEO plugin?

Yes. If you do not run an SEO plugin and do not want one, a small must-use plugin can print the tags from the featured image. Only do this when nothing else prints Open Graph tags, or you will create the duplicate problem described above.

<?php
/**
 * Plugin Name: Basic social preview tags
 * Description: Prints Open Graph and X card tags from the featured image on single posts.
 * Checked on 18 Nov 2026 against WordPress 7.1. Use only when no SEO plugin prints these tags.
 */

add_action( 'wp_head', function () {
	if ( ! is_singular() || ! has_post_thumbnail() ) {
		return;
	}

	$image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
	if ( ! $image ) {
		return;
	}

	$title = wp_strip_all_tags( get_the_title() );

	printf( '<meta property="og:type" content="article" />' . "\n" );
	printf( '<meta property="og:title" content="%s" />' . "\n", esc_attr( $title ) );
	printf( '<meta property="og:url" content="%s" />' . "\n", esc_url( get_permalink() ) );
	printf( '<meta property="og:image" content="%s" />' . "\n", esc_url( $image[0] ) );
	printf( '<meta property="og:image:width" content="%d" />' . "\n", (int) $image[1] );
	printf( '<meta property="og:image:height" content="%d" />' . "\n", (int) $image[2] );
	echo '<meta name="twitter:card" content="summary_large_image" />' . "\n";
}, 5 );

Save it as wp-content/mu-plugins/social-preview-tags.php. It uses the full-size file, which is usually what you want for a 1200 x 630 card; if your originals are huge camera files, register a dedicated image size instead and pass its name. The Open Graph protocol lists og:title, og:type, og:image and og:url as the required properties, which is why the snippet prints all four.

If you do run Yoast and only want to change its choice in code, its Metadata API exposes the wpseo_opengraph_image filter for the image URL. Rank Math has the rank_math/opengraph/image_sizes filter for the sizes it tries (by default full, large and medium_large).

What image shows in Google search results and Discover?

Google picks its own thumbnail, but it does read two hints: the schema.org primaryImageOfPage property (or an image on the main entity) and the og:image tag. Its image SEO guidance asks for an image that is relevant and representative of the page, high resolution if possible, not a generic logo, without heavy text, and without an extreme aspect ratio. Treat it as a strong suggestion that Google may ignore.

SEO plugins such as Yoast also add the featured image to their schema markup, so the same featured image usually feeds both hints. One well-chosen featured image does the job for search, social and embeds at once.

Common mistakes people report

These come up again and again on the WordPress.org support forums. We read each thread on 18 November 2026; the dates are when each was opened.

  • Open Graph turned off, then forgotten. A site owner saw the right image in the share dialog but none on the published Facebook post. Yoast support found no og:image in the page source at all; the Open Graph option had been disabled during testing. Thread, September 2020.
  • The image URL returns 403. Every post on one travel blog shared without an image. The tag was there, but the image file itself returned a 403 error to outside requests, so Facebook could not fetch it. Thread, August 2021.
  • A wrong canonical URL. A homepage kept sharing an old logo and tagline even after re-scraping. Support found the canonical pointed to a different page, so Facebook was reading that page’s tags. Thread, June 2021.
  • Expecting the product image to count as featured. A WooCommerce store saw a different picture than the one in the product description. No Social image, featured image or default was set, so the plugin took an image from the content that was not the one the owner expected. Thread, May 2021.
  • Replacing the featured image and expecting old shares to update. An owner swapped a featured image and re-scraped many times, but the old picture kept appearing. A separate social sharing plugin was also active, and the first thing support asked was which tool managed sharing, because two tools writing tags is the usual cause. Thread, October 2018.
  • No featured image, so the plugin picks one far down the page. With no featured image, the shared card used an image well below the first one, likely because the first did not meet the size rules. Thread, January 2016. The same pattern still appears in newer threads.

The pattern behind all six is the same: the platform shows exactly what the HTML tells it, and the fix is to read that HTML the way the crawler does.

A checklist before you share a new post

  1. Set a featured image, 1200 x 630 pixels or larger, JPG or PNG, under 5 MB.
  2. If the post needs a different social image, set it in the SEO plugin’s Social tab, not by swapping the featured image.
  3. Run the curl command above and confirm there is one og:image, it loads in a private window, and the canonical is this post.
  4. Paste the URL into the Sharing Debugger and Post Inspector before the first real share, so the crawlers have cached the image.
  5. After any later change, use a new image file name, purge your caches, then scrape again.

Frequently asked questions

Does WordPress use the featured image for link previews automatically?

Not by itself. Core does not print Open Graph tags. The featured image is used when a plugin (an SEO plugin or Jetpack) prints them, and core uses it for oEmbed thumbnails when another WordPress site embeds your post.

Why is there no X image tag on my Yoast site?

Yoast only prints it when you set a separate X image. Otherwise X reads the og:image tag, which its own cards reference listed as the fallback.

Is 1200 x 630 still the right size in 2026?

Yes. It meets Facebook’s recommendation and LinkedIn’s minimum of 1200 x 627, and X crops it close enough to 2:1 that nothing important is lost if you keep text away from the edges.

Can I use WebP for the social image?

X lists WEBP as supported. Facebook and LinkedIn do not list formats in the pages we checked, so JPG or PNG is the safer choice for the one image that every platform must read.

Why does the “Preview” button in the editor show a different image?

The editor preview renders your theme, and the theme decides how the featured image appears on the page. Link previews are a separate path that only reads the meta tags in the page head.

Do I need a plugin to fix wrong preview images?

No. You need exactly one source of Open Graph tags. That can be an SEO plugin you already run, Jetpack, or the short must-use plugin above. Two sources at once is the most common cause of the wrong image.

If you are also setting up a site in several languages, the companion guide on adding hreflang tags in WordPress covers the other set of head tags that plugins write for you and that often go wrong in the same quiet way.

Part of the Wbcom Designs family

The all-in-one WordPress community stack

Also ours: wbcomdesigns.comvapvarun.combrndle.com