Site access - Create a members-only store

Community Manager
Community Manager
413 40 1107

You can create a members-only store by showing a login or register page when customers navigate to your website. To make your store accessible only to registered customers, you need to edit your Customer accounts settings in the admin, and add some Liquid code to your theme.


Note: If you want only certain pages to be members-only, then you need to install an access management app from the Shopify App Store.


Enable customer accounts

  1. From your Shopify admin, go to Settings > Checkout.
  2. In the Customer accounts section, click Accounts are required:


  3. Click Save.

Edit your theme.liquid file

  1. From your Shopify admin, go to Online Store > Themes.
  2. Find the theme you want to edit, and then click Actions > Edit code.
  3. In the Layout directory, click theme.liquid.
  4. Find the opening <head> tag in the code. On a new line below the opening <head> tag, paste the following code:

    {% unless customer %}
    {% if template contains 'customers' or request.path == "/challenge" %}
    {% assign send_to_login = false %}
    {% else %}
    {% assign send_to_login = true %}
    {% endif %}
    {% endunless %}{% if send_to_login %}
    <meta content="0; url=/account/login?checkout_url=/" http-equiv="refresh" />
    {% else %}
  5. Find the closing </body> tag in the code. On a new line below the closing </body> tag, paste the following code:

    {% endif %}
  6. Click Save.

Change the page that logged-in customers are redirected to (optional)

Customers that log in are automatically redirected to the home page of the shop. You can edit where customers are redirected by editing the meta refresh tag URL in the code you just pasted.

  1. Find the following <meta> tag in the file:

    <meta content="0; url=/account/login?checkout_url=/" http-equiv="refresh" />
  2. Add the URL path you'd like to use just after checkout_url=/. For example, if you want your logged-in customers to go to your catalog page when they navigate to your site, add collections/all to the URL path. Your code should look like this:

    <meta content="0; url=/account/login?checkout_url=/collections/all" http-equiv="refresh" />
  3. Click Save.

TyW | Online Community Manager @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Replies 45 (45)
New Member
1 0 0

This is exactly what I want do to. I have made my page member only access, but I want it to be only if you have a certain tag. Where do I insert the coding you @martinhalik  mentioned 

{% for tag in customer.tags %}
{% if tag contains 'savage' %}
Well well well...
{% endif %}
{% endfor %}


Thank you!



32 0 18

Not remember exactly but you can put it on specific page template you want to restrict. Or for whole store you can put it in theme.liquid around {{ content_for_layout }}


You will see what it does and then you can proceed based on that.

Here is something similar with demo

Hope it helps.

New Member
1 0 0

checkout error

please help!!


New Member
1 0 0

Hi if we only want a portion of our site (and it's products) to be a "Members Only Area" that requires registration + login (so we can capture emails and ensure they read our Members Area Terms & Conditions) –how would we do that?

[!] Requirements/Desires: 

  • All of site to be public EXCEPT "/membersarea" (has exclusive products, not available pubicly)
  • Anybody may register to become a member (must sign-up with email, sign terms and conditions)
Shopify Expert
255 2 135

If you're comfortable with Liquid, see this post.

If not, see our blog on this topic: How to Create a Shopify Membership Site and Restrict Access to Your Shopify Store


If you're already using Customer Fields for your members-only store, contact

Michael, COO @ Helium
- Customer Fields ✪✪✪✪✪ (265 reviews)
- Meteor Mega Menu ✪✪✪✪✪ (217 reviews)
New Member
1 0 0

How do I make my entire store paid subscription base? This run down helps with creating a member, but what if I want them to also sign up for a monthly or yearly membership?