# Life without {{ghost\_head}}: A somewhat strange blog post

**URL:** <https://forum.ghost.org/t/life-without-ghost-head-a-somewhat-strange-blog-post/42089>\
**Category:** Developer help\
**Created:** [October 21, 2023, 7:33pm UTC](https://forum.ghost.org/t/life-without-ghost-head-a-somewhat-strange-blog-post/42089 "2023-10-21T19:33:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [October 21, 2023, 7:33pm UTC](https://forum.ghost.org/t/life-without-ghost-head-a-somewhat-strange-blog-post/42089/1 "2023-10-21T19:33:45Z")

</div>

New and somewhat strange blog post, in which I speculate about what it’d take to replace {{ghost\_head}} with custom code.

Why would you want to do this? Because it’d let you load a custom version of Portal/Search/Comments even on Ghost Pro.

Why wouldn’t you want to do this yet? Because we’re short a few handlebars helpers of it being an easy drop-in replacement.

> **[Life without {{ghost\_head}}](https://www.spectralwebservices.com/blog/life-without-ghost-head/)**
>
> If you want to customize more fully, you might want to replace {{ghost\_head}} with your own code. Here we break it down.

---

<div class="post-metadata">

**Author:** ![Ravn](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ravn/32/20885_2.png) [@Ravn](https://forum.ghost.org/u/Ravn)\
**Post date:** [October 21, 2023, 8:35pm UTC](https://forum.ghost.org/t/life-without-ghost-head-a-somewhat-strange-blog-post/42089/2 "2023-10-21T20:35:43Z")

</div>

The post is not strange at all. I wanted to make similar one recently.  
Re-creation of {{ghost\_head}} seems to be only way for Ghost(Pro) users to load custom Portal, or Search. I would appreciate some way to edit it without re-doing it from scratch.

Thank you for research Cathy.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [October 21, 2023, 8:54pm UTC](https://forum.ghost.org/t/life-without-ghost-head-a-somewhat-strange-blog-post/42089/3 "2023-10-21T20:54:12Z")

</div>

Thanks for the feedback! :)

I think the biggest limitation/nuisance would be the loss of code injection. Everything else wouldn’t change often, or could probably be dealt with. (Is a schema invalid if it doesn’t specify image sizes??) But if a site is basically static\*\* in terms of layout changes and is just getting new blog posts added, then maybe it’d be OK.

\*\*Does this happen? I’ve never had a site that was not under active development/tweaking, but surely it must happen to some people, right?

---

<div class="post-metadata">

**Author:** ![Ravn](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ravn/32/20885_2.png) [@Ravn](https://forum.ghost.org/u/Ravn)\
**Post date:** [October 23, 2023, 11:47am UTC](https://forum.ghost.org/t/life-without-ghost-head-a-somewhat-strange-blog-post/42089/4 "2023-10-23T11:47:03Z")

</div>

I agree Cathy, it looks like we can’t just get image sizes. Which should not be big deal.

I’ve tried output all code injection in my local install and I found global one under @site.

```auto
{{{@site.codeinjection_foot}}}
{{{@site.codeinjection_head}}}

```

So I wonder why I see them and you don’t, maybe different version of Ghost? Anyway even if something would miss, small requests for changes comes from clients often so we might hard-code various things into default.hbs if needed, or we can instruct clients how to do that on their own.

Anyway thank you for valuable article I guess I will need to read it in near future again. ☺

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [October 23, 2023, 12:03pm UTC](https://forum.ghost.org/t/life-without-ghost-head-a-somewhat-strange-blog-post/42089/5 "2023-10-23T12:03:04Z")

</div>

Thank you! I was confused by not seeing code injection under @site also! I’ll investigate and update. 🙂  
Update: Yep, it’s available under @site, it’s just missing from the documentation. Paging @RyanF - the documentation for @site is missing @codeinjection\_head and \_foot … and several other keys. 🙂

---

<div class="post-metadata">

**Author:** ![RyanF](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ryanf/32/17448_2.png) [@RyanF](https://forum.ghost.org/u/RyanF)\
**Post date:** [October 23, 2023, 3:01pm UTC](https://forum.ghost.org/t/life-without-ghost-head-a-somewhat-strange-blog-post/42089/6 "2023-10-23T15:01:04Z")

</div>

I updated the docs: [Ghost Handlebars Theme Helpers: @site](https://ghost.org/docs/themes/helpers/site/)

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [October 23, 2023, 5:13pm UTC](https://forum.ghost.org/t/life-without-ghost-head-a-somewhat-strange-blog-post/42089/7 "2023-10-23T17:13:24Z")

</div>

Thanks. There’s one more typo:

“UURL specified for this site in your custom config file“

Also, there should be an option to remove this line:

It’s a security risk. Automated scanners can find vulnerable versions of ghost in bulk as long as this header is present, and then exploit them all at once.

It’s a security best practice to do not advertise what version of software you’re running, unless you need to.

Until it’s an option that’s one more reason to replace ghost\_head in a template.
