# How to edit/modify the default.hbs file

**URL:** <https://forum.ghost.org/t/how-to-edit-modify-the-default-hbs-file/60547>\
**Category:** Using Ghost\
**Created:** [October 20, 2025, 10:48pm UTC](https://forum.ghost.org/t/how-to-edit-modify-the-default-hbs-file/60547 "2025-10-20T22:48:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grendell](https://avatars.discourse-cdn.com/v4/letter/g/c2a13f/32.png) [@Grendell](https://forum.ghost.org/u/Grendell)\
**Post date:** [October 20, 2025, 10:48pm UTC](https://forum.ghost.org/t/how-to-edit-modify-the-default-hbs-file/60547/1 "2025-10-20T22:48:30Z")

</div>

Hi there

Am a newbie here and hoping the more learned members can help.

I am trying to add a ‘Back to top’ button and code to our website (which use the default Casper theme) but I am unable to find how to access the default.hbs file into which I understand I must inject the relevant code (which I have prepared).

Would someone be able to provide the steps to access this directly, and if it is a case of downloading the file, editing locally and then uploading back to [ghost.io](http://ghost.io), then please provide the export/import steps.

I am assuming that if it is a case of download, edit, upload, I should make a copy of the pre-update file, and keep it safe so that if the edit does not work or is not what is expected then I can just upload the copy to revert to the website state prior to uploading the updated default.hbs file.

Many thanks in anticipation.

Kind regards,

Grendell

---

<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 20, 2025, 11:57pm UTC](https://forum.ghost.org/t/how-to-edit-modify-the-default-hbs-file/60547/2 "2025-10-20T23:57:29Z")

</div>

If you have directions for code injection, you do that from /ghost \> settings (gear icon) \> code injection.

If you’re following directions to edit the theme, then yes, you’ll download, unzip, edit, rezip, and upload. There are a number of tutorials on theme editing over in [Tutorials](https://ghost.org/tutorials) that will get you started!

---

<div class="post-metadata">

**Author:** ![Grendell](https://avatars.discourse-cdn.com/v4/letter/g/c2a13f/32.png) [@Grendell](https://forum.ghost.org/u/Grendell)\
**Post date:** [October 21, 2025, 9:00pm UTC](https://forum.ghost.org/t/how-to-edit-modify-the-default-hbs-file/60547/3 "2025-10-21T21:00:48Z")

</div>

Hi Cathy

Many thanks for the pointer…I will investigate.

But may I check on one key point for me…is it good practice to export one’s site and keep a copy safe, so as to be able to import it at a later date if something happens to the site?

Or is there a better way to achieve the same end…website recovery in case of issue, etc.?

Many thanks for your assistance in this matter. It is much appreciated.

Regards, Grendell

---

<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, 2025, 9:16pm UTC](https://forum.ghost.org/t/how-to-edit-modify-the-default-hbs-file/60547/4 "2025-10-21T21:16:48Z")

</div>

Exporting your site makes a backup of your posts and pages and config settings. (Not images.) it does NOT back up your theme files. And uploading/downloading theme files will not harm content. They’re separate. Certainly it’s a good idea to maintain a backup copy of your theme files before editing, in case you want to go back to something you had before.

---

<div class="post-metadata">

**Author:** ![Grendell](https://avatars.discourse-cdn.com/v4/letter/g/c2a13f/32.png) [@Grendell](https://forum.ghost.org/u/Grendell)\
**Post date:** [October 21, 2025, 9:40pm UTC](https://forum.ghost.org/t/how-to-edit-modify-the-default-hbs-file/60547/5 "2025-10-21T21:40:37Z")

</div>

Hi Cathy

Thanks for the prompt response. However, I am a bit confused by it…so would just like to make sure I am straight here.

1. Exporting one’s site makes a backup of posts, pages & config settings but NOT images.
2. And it does NOT back up one’s theme files.

So, if one is editing the theme files, i.e., default.hbs, for example (have I got that right that this is one of them?), then how does one create a backup copy of the theme files.

What am I missing/getting wrong re. my understanding…apologies I am a newbie on a big learning curve.

Thank you for your patience…it is appreciated.

Regards, Grendell

---

<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, 2025, 11:01pm UTC](https://forum.ghost.org/t/how-to-edit-modify-the-default-hbs-file/60547/6 "2025-10-21T23:01:38Z")

</div>

In order to edit the theme you’re going to download it anyway. So you just save an unedited copy.
