Restrict whole page unless customers are logged in

Topic summary

A user seeks to restrict their entire Shopify storefront to logged-in customers only, creating a login/registration gate for public visitors. They attempted using the Locksmith app but found it complicated with slow support, prompting them to pursue a code-based solution instead.

Proposed Solution:

  • Another participant suggests implementing this through custom code
  • References a tutorial article about locking Shopify stores to unlogged customers
  • Notes the solution would need adaptation to specific requirements

Additional Requirement:

  • The original poster wants to allow one specific page (plus account login/registration sections) to remain accessible while restricting everything else

Status: The conversation confirms the code solution allows ‘/account’ pages (login and registration) to load by default. The discussion remains open regarding how to whitelist the additional specific page while maintaining the overall restriction.

Summarized with AI on November 12. AI used: claude-sonnet-4-5-20250929.

Hi all,

Trying to restrict the whole page only to logged-in customers I have tried several ways but didn’t success. Also tried Locksmith but it was complicated and support was really slow. So I have decided to do it without an app.

What is the possibility of creating a storefront for public visitors such as the image below? I want everyone to see that storefront and if they are already customers redirect to the login page. if they are not customers redirect to the register form page.

Hi.

It should be possible to do it in code.

We have an article about it here: https://www.froonze.com/blog/how-to-lock-shopify-store-to-unlogged-customers

but you would need to adapt your solution to what you need.

Ok thanks will look into it!

Also they need to be allowed to see one specific page and account login section. Is that code restricting whole the site?

Hi.

The code in the article allows ‘/account’ pages to load, like login and registration