This solution helps you create password-protected collections in your Shopify store. When customers try to access these collections, they’ll see a popup asking for a password, along with a contact form to request access if needed.
Key Features:
Simple password protection for any collection
Professional popup design with password field
Built-in contact form for password requests
Automatic access remembering (using browser storage)
Mobile-responsive layout
Implementation Requirements:
Basic Shopify store access
Ability to edit theme code
Metafields enabled for collections
The system stores successful password entries locally, so customers won’t need to re-enter passwords during their browsing session. For store owners, you can set different passwords for different collections through Shopify’s metafields interface.
1. Make Changes in Liquid Code
You need to add the following code in your theme.liquid
or collection template:
{% if collection.metafields.custom.password_protected %}
Enter Password
This collection is password protected. Please enter the password to view.
Don't have the password? Contact us
{% form 'contact' %}
{% if form.posted_successfully? %}
Thank you! We'll contact you soon with the password.
{% endif %}
{% endform %}
{% endif %}
2. Use Metafields
Go to Shopify Admin → Settings → Custom Data
Create a new definition for “Collections” with the following fields:
password_protected
(Boolean type)collection_password
(String type)
3. Set Password for Each Collection
Go to the collection you want to protect
In the Metafields section:
Set
password_protected
totrue
Enter your desired password in the
collection_password
field