How to customize the private site access template in Ghost

Learn how to customize the private site access template in Ghost, enabling you to create a personalized experience for your password protected site.

Norbert
Norbert2 min read

Private sites are perfect when you want to limit access to your content. Whether you're still working on your site's design or creating exclusive content for a small community, password protection is a great option.

When password protection is enabled, Ghost disables social sharing and search engine indexing, requiring visitors to enter a password to access your content.

Enabling password protection for your Ghost site

To make your site private, go to Ghost Admin > Settings. Under the General settings, find the Make this site private option. Toggle Enable password protection, set your password, and save the changes.

Ghost CMS - Make site private
Ghost CMS - Make site private

This is designed for the typical use case—a site with restricted access using a shared password. When visitors arrive at your website, they’ll see a password field. Only those with the password can proceed to view the content.

The default private.hbs template

Ghost uses a single template for the private access page across all themes. This template is located in the private.hbs file within Ghost core.

After enabling password protection and saving it, visitors will see a message: "This site is private" alongside the password field.

Ghost - This site is private
Ghost - This site is private

Anyone who knows the password can enter it to unlock the site.

Customizing the private.hbs template

The default private access template is simple, but it can be customized to better match your site’s needs.

Here’s how to customize it:

  1. Create a private.hbs file in the root of your theme.
  2. Copy the code from the default private.hbs.
  3. Make your changes to the template.
  4. Re-upload your modified {theme}.zip file to Ghost.

The most common changes will likely be in the <body> section. You can:

  • Modify the "This site is private" message.
  • Add additional content, such as a description.
  • Include a contact or subscription form.
  • Add a cover image to enhance the design.

Customizing the private site access page in Ghost allows you to create a more personalized experience for visitors. By editing the private.hbs template, you can adjust the message, design, and functionality to better fit your site's purpose while still keeping it restricted to authorized viewers.

More in Guides & Tutorials

All guides

How to use custom fonts in Ghost themes

Enhance your Ghost blog's visual appeal with custom fonts. Learn to add, define, and apply fonts using simple steps and the Code Injection feature for a unique, brand-aligned look.

Ghost Pro Hosting

Get the best managed Ghost CMS hosting and focus on bringing value to your audience.