Ghost {{meta}} helper: how SEO tags are generated and when to override them
Keep {{meta}} in default.hbs and use per-post Custom SEO for reliable OpenGraph and Twitter tags in Ghost 5.x. Override with a custom meta.hbs partial only when you need different tag order or attributes, and test on staging.
27 Sept 2026, 04:34 UTC

The useful answer first
If you want reliable title, description, OpenGraph and Twitter Card tags in Ghost 5.x without adding plugins, keep the Handlebars helper {{meta}} in your theme’s default.hbs head and use the per-post Custom SEO fields in Admin. The helper pulls from post data, author data and site settings, and falls back to title and excerpt when custom fields are empty. Override it only when you need a different tag order or custom attributes site-wide, and do that via a custom meta.hbs partial in a staging theme.
How the SEO tags are built in Ghost 5.x
Ghost renders meta tags from the layout, not from a plugin. In a standard theme the head of default.hbs contains:
<head>
<meta charset="utf-8" />
<title>{{meta_title}}</title>
{{ghost_head}}
</head>
{{ghost_head}} is the legacy entry point. Modern themes use the explicit helper:
<head>
<meta charset="utf-8" />
{{meta}}
</head>
The {{meta}} helper reads, in order of precedence:
- Post
meta_titleandmeta_descriptionwhen Custom SEO is enabled for that post. - Otherwise post
titleandexcerpt. - Site title, description, logo and author data from site settings.
It then outputs standard meta tags plus OpenGraph and Twitter Card tags. Tags are only emitted for public pages. Preview or unpublished posts do not emit them.
Worked configuration: a custom meta.hbs partial
To change tag order or add a custom attribute without editing core, create a partial that replaces the default helper output. This is a theme-level change, so work in a copy of the theme and test on staging.
File path in the theme: partials/meta.hbs. Required permission: Admin access to Ghost Admin → Settings → Design → Upload theme, or filesystem write access to the active theme folder.
{{! partials/meta.hbs }}
{{! Reorder and add a custom attribute for verification }}
{{meta_title}}
Then in default.hbs replace {{meta}} with:
{{> meta}}
Expected checks after redeploying the theme:
- View page source in a browser for a published post and confirm
<title>andmeta name="description"match the values set in Admin → Post → SEO. - Disable Custom SEO for the same post and confirm the helper falls back to post title and excerpt.
- Confirm OpenGraph tags reference the feature image URL when present.
Relevant risks: changes to meta.hbs affect all pages. A syntax error in the partial can break the head rendering for the entire site. Test in staging before production.
Limits and common mistakes
Fallback behavior
Ghost’s SEO tags rely on the excerpt field. If excerpt is empty, the description tag will be omitted. The helper does not auto-detect language if the language field is missing from site settings; you may need to set it manually in Admin → Settings → General.
Canonical and robots
The {{meta}} helper does not generate canonical URLs for paginated archives. You need to add <link rel="canonical" href="..."> manually for those templates. Ghost respects the robots.txt setting in Admin → Settings → Advanced and does not expose meta robots tags automatically.
When not to remove the helper
Removing {{meta}} for perceived performance removes all OpenGraph and Twitter Card metadata. Search engines and social platforms will then see no metadata, harming presentation.
Verification checklist
- Create a new post in Ghost Admin, enable the Custom SEO toggle, set a custom meta title and description.
- Publish the post and view source to confirm the custom values appear.
- Toggle Custom SEO off and verify fallback to title and excerpt.
- If using a custom
meta.hbs, redeploy the theme and confirm the new tag order appears in source. - Check Admin → Settings → Advanced → robots.txt and verify the generated
/robots.txtreflects the chosen policy.
Rollback for the partial change is to remove the custom partials/meta.hbs file and restore {{meta}} in default.hbs, then re-upload the previous theme zip. Keep a versioned copy of the theme before editing.
Version assumption: behavior described applies to Ghost CMS 5.x themes using the {{meta}} helper. Admin UI labels may vary slightly across minor releases.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.