Enhancing Ghost CMS SEO with Custom Head Tags: A Practical Guide
Ghost CMS defaults to minimal meta tags, limiting SEO and social previews. This guide shows how to add a Handlebars partial that injects dynamic Open Graph and Twitter Card tags per post, boosting click‑through rates and search visibility.
31 May 2026, 22:41 UTC

Problem: Ghost’s Built‑In Meta Is Too Simple for Modern SEO
When you first publish a post in Ghost, the default theme injects a handful of meta tags: <title>, <meta name="description">, and a canonical link. That’s enough for a basic site, but search engines and social platforms now expect richer Open Graph (OG) and Twitter Card data to generate compelling previews. Without them, your content may appear bland in search results or fail to load correctly on Facebook, LinkedIn, or Twitter.
Takeaway: Adding a custom Handlebars partial lets you generate dynamic OG and Twitter meta tags per post without touching Ghost’s core or making extra API calls.
Why Custom Meta Matters
- Search Visibility: Search engines use title and description tags to decide relevance and display snippets.
- Social Engagement: OG and Twitter Card tags control the image, title, and description that appear when a link is shared.
- Performance: Server‑side rendering keeps the tags in the initial HTML, so crawlers don’t need to execute JavaScript.
How to Add Custom Meta via a Handlebars Partial
Ghost’s theming system is built on Handlebars. The default post.hbs and page.hbs templates automatically render {{> meta}}, a partial that includes the standard tags. To extend this logic, create a new partial that adds your custom tags and reference it in the template.
- Create the partial
{{!-- partials/meta-custom.hbs --}} {{!-- Standard Ghost meta – keep for fallback --}} {{> meta}} {{!-- Open Graph tags --}} <meta property="og:type" content="article"> <meta property="og:title" content="{{meta_title}}"> <meta property="og:description" content="{{meta_description}}"> <meta property="og:url" content="{{url absolute="true"}}"> {{#if feature_image}} <meta property="og:image" content="{{feature_image absolute="true"}}"> {{/if}} {{!-- Twitter Card tags --}} <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:title" content="{{meta_title}}"> <meta name="twitter:description" content="{{meta_description}}"> {{#if feature_image}} <meta name="twitter:image" content="{{feature_image absolute="true"}}"> {{/if}} - Reference the partial in your theme
{{!-- post.hbs – or page.hbs – at the top of the file --}} {{> meta-custom}} - Deploy and verify
- Publish a test post.
- Open the page source and look for
<meta property="og:title" …>and Twitter tags. - Use Facebook Sharing Debugger and Twitter Card Validator to confirm rendering.
- Run Lighthouse’s SEO audit to ensure tags are detected.
Worked Example: A Blog Post with Rich Social Preview
Assume a Ghost post titled “10 Tips for Faster Web Apps” with a feature image at https://example.com/content/images/2026/10/fast-apps.jpg. After publishing, the rendered HTML will contain:
<meta property="og:title" content="10 Tips for Faster Web Apps">
<meta property="og:description" content="Learn how to reduce load times and improve performance.">
<meta property="og:url" content="https://example.com/10-tips-faster-web-apps">
<meta property="og:image" content="https://example.com/content/images/2026/10/fast-apps.jpg">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="10 Tips for Faster Web Apps">
<meta name="twitter:description" content="Learn how to reduce load times and improve performance.">
<meta name="twitter:image" content="https://example.com/content/images/2026/10/fast-apps.jpg">
These tags will now appear in the link preview on Facebook, LinkedIn, and Twitter, increasing click‑through rates.
Trade‑offs & Limitations
- Theme Updates: If you overwrite the default
meta.hbsorpost.hbs, your changes may be lost. Use a child‑theme or keep your partial in a dedicated folder to avoid this. - Page Size: Adding many tags increases the HTML payload. Keep tags concise and avoid duplicate OG properties.
- Absolute URLs: OG and Twitter images must be absolute and publicly accessible. Verify that the image URL is reachable from a headless browser.
- Duplicate Tags: Ghost’s
{{> meta}}already emits aog:titletag if you enable it in Settings → SEO. Ensure you don’t produce duplicates, which can confuse crawlers.
Actionable Closing
By adding a small meta-custom.hbs partial, you can enrich every Ghost post with the exact meta data search engines and social platforms expect. Test the tags with preview tools, keep the partial in a child‑theme to survive updates, and monitor your SEO audit for any new issues. Once in place, your content will look better in search results and social feeds, driving higher engagement without any runtime overhead.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.