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.
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.
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:
- Create a
private.hbs
file in the root of your theme. - Copy the code from the default private.hbs.
- Make your changes to the template.
- 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.