How to set a default social share image in WordPress

To set a default social share image in WordPress with Hydrogen SEO, open Hydrogen SEO → Social, click the Default share image field, choose a 1200×630 pixel image from the Media Library and save. It is printed as og:image and twitter:image on any page that has neither a social image nor a featured image.

Without a fallback, a shared link to a category page, a text-only post or a legal page shows no image, or whatever the app scrapes from the page: an icon, an avatar, an advert. A default makes every share at least recognisably yours.

Step by step

1. Find the pages that have no image

The fallback only matters where nothing better exists. Typical gaps: posts without a featured image, category and tag archives, the blog index, search and utility pages. Check one:

bash
curl -s https://example.com/category/news/ | grep -o '<meta property="og:image"[^>]*>'

No output means that page currently shares without an image.

2. Design one image for every context

Make a single image that works for any page on the site:

  • Size: 1200×630 pixels, a 1.91:1 ratio, which is the format large link cards use.
  • Content: your logo or name, and at most a short line of text, large and centred. Apps crop the edges differently, so keep a margin of about a tenth of the width clear on every side.
  • Format: JPEG or PNG. Keep the file to a few hundred kilobytes so it loads quickly when an app builds the card.
  • No page-specific text. It will appear under many different titles.

3. Upload it in the plugin

  1. Go to Hydrogen SEO → Social.
  2. Under Default share image, click the image field to open the Media Library.
  3. Upload or choose the image.
  4. Save.

Use Replace to change it later. The same screen holds the Open Graph tags and X (Twitter) card tags switches. Both must be on for the image to be printed.

4. Know the order of priority

The default never overrides something more specific. For each page the plugin uses, in order:

  1. The OG image set in that post's SEO Settings sheet.
  2. The post's featured image.
  3. The default share image.

The homepage has its own OG image field on Hydrogen SEO → Homepage, which is used before the default.

5. Confirm it is printed

Purge the cache and repeat the curl command on a page from step 1. You should now see an og:image line with the full URL of your image. Then check a post that has a featured image and confirm it still prints its own.

6. Preview the card and refresh caches

Paste the page head into the Open Graph preview. For links that were shared before you added the image, each platform holds the old card in its cache. Facebook's Sharing Debugger and LinkedIn's Post Inspector fetch the page again on request. Other apps refresh on their own schedule, and adding a query string to the shared URL forces a fresh scrape while you test.

A fallback is a safety net. A post shared with a specific, relevant image gets more attention than one with a logo card. Make a featured image part of your publishing checklist and keep the default for the pages that will never have one.

Without the plugin

If you print Open Graph tags from your own wp_head function, add a fallback branch that uses a fixed attachment:

php
$image = has_post_thumbnail( $post )
    ? get_the_post_thumbnail_url( $post, 'full' )
    : wp_get_attachment_image_url( 1234, 'full' ); // ID of your default image
if ( $image ) {
    printf( '<meta property="og:image" content="%s" />' . "\n", esc_url( $image ) );
}

Find the ID in the Media Library: open the image and read item=1234 in the address bar. Using the ID, not a pasted URL, keeps the tag correct if the site moves to another domain.

Why an image may still not appear

  • The image URL is blocked. If robots.txt disallows the uploads folder, or hotlink protection rejects the platform's crawler, the tag is there but the image cannot be fetched.
  • The site is behind a login or "coming soon" page. Scrapers see the gate, not your tags.
  • Two sets of tags. Another plugin or the theme prints its own og:image first. Apps use the first one they find.
  • The image is too small. Very small images are shown as a thumbnail beside the text or ignored.

Common questions

What size should a default share image be?

1200×630 pixels, a 1.91:1 ratio. It displays as a large card on the major platforms and scales down cleanly.

Does the default image replace my featured images?

No. A post's own social image or featured image always takes priority. The default is used only when a page has neither.

Does the share image affect Google rankings?

No. It affects how links look when shared. Google's own image previews in search come from images on the page, and are governed by the max-image-preview setting.