← All guides

CMS Guide

Ghost OG Images: Where the Card Comes From and How to Fix It

How Ghost's {{ghost_head}} helper builds og:image and twitter:image, the exact fallback order for posts, tags and the homepage, the Facebook and X card settings, themes that leave the helper out, and the sizes Ghost serves, read from Ghost 6.79's source.

How Ghost produces OG tags

Ghost has no SEO plugin to install and no tag setting to switch on. The tags come from one Handlebars helper, {{ghost_head}}, which a theme calls inside <head>. In Ghost's source (v6.79.0, read on 24 November 2026) ghost_head.js asks the meta layer for the page's data and prints, in this order: the meta description, the icon, the canonical link, a robots tag, pagination links, the Open Graph and X tags, the JSON-LD block, the generator tag, the RSS link, then scripts, styles and any code injection.

The Open Graph and X tags are one block called structured data. The helper skips it in three cases: the request is a paged URL (page 2 and beyond of any listing), the site's configuration disables structured data (privacy.useStructuredData set to false on a self-hosted install), or the theme wrote {{ghost_head exclude="social_data"}}. Ghost's help page for the helper lists the output as "Structured data tags for Facebook Open Graph and Twitter Cards" and does not mention the exclude option; that comes from the code.

This is what Ghost's own demo site serves for a post, fetched with a crawler user agent (the image URL is shortened here):

<meta property="og:site_name" content="Ghost">
<meta property="og:type" content="article">
<meta property="og:title" content="Start here for a quick overview of everything you need to know">
<meta property="og:url" content="https://demo.ghost.io/welcome/">
<meta property="og:image" content="https://storage.ghost.io/c/ba/d9/.../content/images/2022/05/welcome-to-ghost.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://storage.ghost.io/c/ba/d9/.../content/images/2022/05/welcome-to-ghost.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="660">
<meta name="generator" content="Ghost 6.79">

Three things in that head decide most Ghost sharing problems:

  • The image is chosen by context, then by a fixed list. A post, the homepage, a tag page and an author page each walk a different list. The next section prints them.
  • Open Graph and X walk different lists. The X list has its own image field, and it never reads the Facebook one.
  • Ghost measures the image. It fetches the image's dimensions and prints og:image:width and og:image:height, and it swaps in a smaller copy when the image is wider than 1200 pixels.

The site audit detects Ghost from the Ghost generator tag, so its image_missing finding names the Ghost settings and links this guide. The findings themselves work the same.

Where og:image and twitter:image come from

The lists below are the code in og-image.js and twitter-image.js. The first value that exists wins. "Site" means a setting under the publication's Meta data settings, not a post field.

A post or a page

  1. og:image: the post's Facebook card image, then its feature image, then the site's Facebook card image, then the site's cover image.
  2. twitter:image: the post's X card image, then its feature image, then the site's X card image, then the site's cover image.

The homepage

og:image is the site's Facebook card image, else its cover image. twitter:image is the site's X card image, else its cover image.

A tag page

og:image is the tag's Facebook card image, then the tag's feature image, then the site's cover image. The X list is the same with the tag's X card image first. A tag page skips the site's Facebook and X card images and goes straight to the cover image.

An author page

The author's cover image, and nothing else. An author with no cover image has no og:image, whatever the site settings say.

Everything else

The code only names the contexts above. A custom collection's index (a route such as /blog/ when the homepage is a different template) is none of them, so its structured data has no image to print. I read that from the routing and meta code and did not fetch one, so check any custom collection you run. Paged URLs print no social tags at all.

What this means in practice

  • A post with no feature image and no card image shares the site's image. That is the intended last resort, and it is also the reason many posts on a Ghost site show the same card.
  • The X card does not read the Facebook card image. If you set only a Facebook card image on a post, X still uses the feature image. The help page says that for X "if the X data is not set, the custom meta data is used", which holds for the title and description; for the image the code follows the list above, and that is what this guide follows.
  • The card type follows the image. Ghost prints twitter:card as summary_large_image when it found an X image or a cover image for the page, and summary otherwise.
  • Titles and descriptions have their own fallbacks. For a post, og:title is the Facebook title, else the meta title, else the post title. og:description is the Facebook description, else the custom excerpt, else the meta description, else a 50 word excerpt of the post, else the site description. The X tags follow the same shape with their own fields.

Set the site-wide cards first

The site-wide settings are the safety net under every post that has no image of its own. In Ghost's admin source they live in the Meta data group of the general settings, which has three tabs: Search, X card and Facebook card. Ghost's SEO help page gives the path as Settings, General, Meta data and says the section is for custom metadata for the homepage "for search engines and social media".

The fields behind the tabs are og_image, og_title and og_description for the Facebook card, and twitter_image, twitter_title and twitter_description for the X card. Set both images to the same 1200 by 630 card unless you want the networks to differ.

Two other settings feed the same lists. The publication's cover image, which many themes use as a homepage banner, is the next fallback after the card images for posts, and the first one for tag pages. A theme that asks you to upload a banner there is therefore also choosing your fallback card. If you set no card images, the banner is what every un-imaged post shares, usually a wide hero photo that was never cut for sharing.

On Ghost's demo site the homepage head shows the cover image fallback working: its og:image and twitter:image are the same Unsplash photo URL, with og:image:width 1200 and og:image:height 840.

Set the Facebook and X card on a post

Ghost's post settings help page lists the post settings menu's sections in this order: Post URL, Publish date, Tags, Post access, Custom excerpt, Authors, Custom templates, Featured post, Post History, Meta data, X card, Facebook card and Code injection. The page says only "the post settings menu in the editor", so it gives no icon or button name; open the settings from the editor and look for those headings. In the editor's source the Meta data pane has the same three tabs as the site settings.

Each card has an image, a title and a description, with a preview below. Ghost's help describes them this way: the Facebook card adds "custom Open Graph data for sharing your post on the Facebook platform", and for X, "If the X data is not set, the custom meta data is used."

Use the card fields when the feature image is a poor card. A feature image is cropped for the theme's post layout and carries no title. A card image uploaded to the post's Facebook and X cards is used as is, ahead of the feature image. Upload one image to both so the two networks agree.

Tags can carry their own Facebook and X cards too: the tag editor in Ghost's source has the same two sections. Authors cannot: the code reads only the author's cover image, and Ghost's own description code notes that the author meta fields have no UI.

The properOG generator produces a clean 1200 by 630 PNG with your title on it. Upload it to the post's Facebook card and X card, or to the site settings above.

A theme that leaves out {{ghost_head}}

Symptom

You set card images in the admin and the page source has no og:image, no description tag, no canonical link and no generator tag at all.

Cause

Every tag in this guide is printed by {{ghost_head}}. A theme that does not call it, or calls it outside <head>, ships none of them, and no setting in the admin can restore them. This happens with hand-built themes and with themes trimmed from a starter. Ghost's theme documentation describes the helper as the place the structured data, the code injection and the API scripts all arrive, so a theme without it loses all three.

Fix

Open default.hbs (or whichever layout holds your <head>) and add the helper before the closing tag. A minimal head:

<head>
    <title>{{meta_title}}</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    {{ghost_head}}
</head>

Upload the edited theme and fetch a post again. If you want your own tags in place of Ghost's, you can exclude the block ({{ghost_head exclude="social_data"}} in the code's option list), but then you own every og: and twitter: tag, including the image and its dimensions, on every route. Keep the helper's output unless you have a reason not to.

{{ghost_head exclude="social_data"}}

Two sources printing tags

The opposite fault is a second og:image. Code injection, whether the site-wide header or a post's own header, is printed after the structured data block, so a snippet that adds an og:image there gives the page two. Facebook's documentation does not say which of several it uses. properOG's checker reads the first one in the document, which is Ghost's. Remove the one you do not want.

Detected by

The checker's image_presence check, and the audit's image_missing finding, which lists the pages with no og:image. A theme that drops the helper fails on every route at once.

Many posts show the same card

Symptom

Different posts shared on the same network show one identical image.

Cause

Those posts have no card image and no feature image, so they all landed on the site's card image or cover image in the lists above. The X tag can also differ from the Open Graph one: if you set the site's X card image and not the Facebook one, a post with no images gets the X image for twitter:image and the cover image for og:image.

Fix

Give every post its own image, as a feature image or as a card image. Where that is too much to do by hand, set the site's card images deliberately so the shared one is at least a branded card, not a banner photo.

Detected by

The audit's image_shared finding, which fires when one image covers pages from more than one template, and twitter_image_shared when one twitter:image differs from the shared og:image. The finding lists the shared URL and how many pages carry it.

Image sizes Ghost serves

Ghost uploads an image to /content/images/ and keeps the original. For the social tags it applies one rule, in image-dimensions.js: it reads the image's width and height, and when the width is over a limit it prints scaled dimensions and, for an image on your own site, a resized URL.

  • The limit is 1200 pixels wide. The configuration names it as the social-image size, and the code falls back to 1200 when none is set.
  • A wider image gets a /size/w1200/ URL. A 2400 pixel feature image stored by Ghost is advertised as a 1200 pixel copy, with the height kept in ratio, and Facebook's 1200 pixel recommendation is met without you resizing anything.
  • A narrower image is never enlarged. A 800 pixel wide image is advertised as it is. That is the usual cause of a soft card, and the audit reports it as image_undersized for any card under 1200 pixels wide.
  • An image hosted elsewhere is not rewritten. The URL stays as it is, but the printed width and height are still scaled to 1200 wide. Ghost's own demo shows it: the homepage image URL carries w=2000 while the tags say 1200 by 840. If your cover image lives on another host, the declared size can disagree with the file.
  • The ratio is whatever you uploaded. Ghost does not crop. A square or portrait feature image is advertised as it is and cropped by the network.

Facebook's documentation asks for images of at least 1200 by 630 pixels, as close to 1.91:1 as possible, with a 200 by 200 pixel minimum and an 8 MB limit. Upload cards at 1200 by 630 and the resize rule never has to act.

Ghost sets og:image:width and og:image:height for the image it picked, which matters to Facebook: its documentation says declaring dimensions lets the crawler render the image on the first share, where otherwise "the first sharer won't see it".

You changed the image and the old card still shows

Symptom

You replaced the feature image or card image, the page source shows the new URL, and a shared link still shows the old card.

Cause

Facebook caches an image by its URL. Its documentation says that when you replace an image you should use a new URL, and that existing shares do not update on their own. Ghost's help page for post settings says the same of the Open Graph data: "Facebook caches the Open Graph data for your post when published", and points you to the Facebook Sharing Debugger.

So the old card persists when the image was swapped at the same URL, for example in a CDN or object store in front of your content folder, or when the network has not fetched the page since you changed it.

Fix

Give the new card a new URL (a different file name is enough), set it on the post or site, save, then run the post's URL through Facebook's debugger (see the Facebook guide linked below). If a CDN or page cache sits in front of your site, purge it too, since it can hold the old head. Ghost's demo site answers with cache-control: public, max-age=0 behind a CDN, which shows that a CDN can be in the path; yours may be configured differently.

Verify your fix

Read the head as a crawler does. Request the post with a crawler user agent and print the tags. Ghost writes each as a <meta> element with property or name first:

curl -sA 'facebookexternalhit/1.1' https://your-site.com/your-post/ \
  | grep -oE '<meta (property|name)="(og|twitter):[^"]*" content="[^"]*"'

Check one post, the homepage, a tag page and a page with no feature image, since each walks a different list. Count the og:image lines and open the URL on the one you expect.

Check one URL. The properOG checker scores the card for reachability, dimensions, file size and tags, and renders how it looks on each platform. Enter your post's URL. You can also check the example page from this guide.

Audit the whole site. The site audit reads your sitemap, groups URLs into templates (posts, tags, pages) and samples across them, so it reports image_missing, image_shared and image_undersized for the template that has the fault, not only the page you tried.

Refresh the networks. Use the Facebook Sharing Debugger for Facebook's copy, and see the Facebook link preview guide, the X card guide and the LinkedIn guide for each network's own cache and tools.

Frequently Asked Questions

How do I set the Open Graph image in Ghost?

Set a site-wide card image in the admin under Settings, General, Meta data, on the Facebook card and X card tabs, then give each post a feature image or its own Facebook card and X card images from the post settings menu. Ghost uses the post's card image first, then its feature image, then the site's card image, then the publication cover image.

Why is my Ghost post missing og:image?

Ghost prints og:image from the {{ghost_head}} helper. If your theme does not call it inside the head, no social tags print. If it does, the post had no card image, feature image, site card image or cover image to use. Paged URLs and some custom collection index pages also print none.

Does the X card use the Facebook card image in Ghost?

No. For a post, twitter:image is the X card image, then the feature image, then the site's X card image, then the cover image. It never reads the Facebook card image, so set both if you want one card on both networks.

What size should a Ghost OG image be?

Upload 1200 by 630 pixels. Ghost advertises an image on your own site at up to 1200 pixels wide by serving a resized copy, never enlarges a smaller one, and does not crop, so a square or portrait image keeps its shape and the network crops it.

Why does Facebook show my old Ghost card after I changed it?

Facebook caches an image by its URL and does not refresh existing shares by itself. Upload the new card so it gets a new URL, save, and fetch the post again in the Facebook Sharing Debugger. If a CDN sits in front of your site, purge it too.

Audit your site

Sample pages across every template in your sitemap and see which ones ship the wrong card, or none. Free, no account needed.

Related guides