Website Building » Shopify » Can I Password Protect One Page on Shopify?

Can I Password Protect One Page on Shopify?

Last updated on January 12, 2023 @ 9:54 am

Yes, you can password protect one page on Shopify. To do this, you’ll need to create a password-protected page template and then assign it to the page that you want to protect.

Here’s how to create a password-protected page template:

1. Go to Online Store > Themes > Edit HTML/CSS.
2. Under Layout, click Add a new layout.
3. In the Layout name field, enter a name for the layout (for example, Password Protected Page).
4. In the Template name field, enter password-protected-page.liquid.
5. Paste the following code into the layout:

<body>
{% if protected_page_password != blank %}
{% if protected_page_password == password %}
{{ content_for_layout }}
{% else %}

This page is password protected.





{% endif %}
</body>

PRO TIP: While it is possible to password protect individual pages on Shopify, it is not recommended as a security measure. This is because the password protection can be bypassed by simply viewing the source code of the page. If you are concerned about security, it is better to password protect your entire shop or use an alternate method of protecting individual pages.

6. Click Save.

Morgan Bash

Morgan Bash

Technology enthusiast and Co-Founder of Women Coders SF.