Ghost Open Graph Meta Tags: Built-in OG Support and Custom Injection

Ghost CMS adds og:title, og:image, and og:description automatically. Learn how to customize OG tags per post, use Code Injection for overrides, and fix Ghost preview issues.

Ghost's built-in OG support

Ghost CMS generates Open Graph and Twitter Card tags automatically for every post, page, and tag archive. You don't need to install a plugin or write code. Ghost pulls data from your post settings:

  • og:title — from the post title (or custom "Meta title")
  • og:description — from the post excerpt or custom meta description
  • og:image — from the post feature image or custom OG image
  • og:url — from the post URL
  • og:typearticle for posts, website for pages

Customizing OG tags per post

Ghost allows you to set a custom social sharing title, description, and image for each post independently:

  1. Open the post editor
  2. Click the gear icon (⚙) to open Post Settings
  3. Scroll to Facebook card and Twitter card sections
  4. Set a custom title, description, and upload a dedicated OG image

Ghost stores these as separate fields from your post title — useful when you want a shorter or more compelling title specifically for social sharing.

Site-wide OG settings

Configure default OG data for your Ghost publication:

  1. Go to Ghost Admin → Settings → General
  2. Set a Publication cover image — this is the fallback og:image for pages without a feature image
  3. Under Metadata, set a title and description for the homepage

Using Code Injection for custom OG tags

For advanced customization, use Ghost's Code Injection feature to add or override meta tags globally or per-page:

Global: Settings → Code Injection → Site Header

<!-- Site Header Code Injection (all pages) -->
<script>
  // No JS needed — meta tags go directly in the head
</script>
<!-- Override twitter:card type globally -->
<meta name="twitter:card" content="summary_large_image" />

Per-post: Post Settings → Code Injection → Post Header

<!-- Post Header Code Injection (this post only) -->
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />

Ghost theme OG template variables

If you're building or modifying a Ghost theme, OG tags are rendered by Handlebars helpers. The {{ghost_head}} helper outputs all meta tags automatically:

{{!-- default.hbs --}}
<head>
  {{ghost_head}}
</head>

Ghost themes that use {{ghost_head}} get OG tags, JSON-LD, RSS link, and other SEO meta automatically.

Common Ghost OG issues

  • Feature image too small: Ghost resizes images, but crawlers may receive a small version. Upload images at 1200×630 px or larger.
  • Missing feature image: without a feature image, Ghost uses the publication cover. Set a cover image in General Settings as a fallback.
  • Custom domain not configured: if your Ghost site URL is set to localhost or a staging domain, og:url and og:image will reference the wrong domain. Update URL in Settings → General.

Preview your OG tags free at OGFixer.com → Paste your Ghost post URL to see exactly how your link card looks on Twitter, LinkedIn, Discord, and Slack.

← All guides