1. Home
  2. Documentation
  3. WooCommerce Private Store
  4. Getting Started
  5. How to unlock the private store for logged in users

How to unlock the private store for logged in users

The WooCommerce Private Store plugin provides two ways of hiding all your WooCommerce content. This includes products, product categories, the main shop page, cart, checkout, etc.:

  1. Password protection (the default) – Customers must enter a password onto the store login page to unlock the hidden WooCommerce store.
  2. Automatically unlock store for logged in users – If you don’t want to use the password protection, then you can tick the Logged In Users box on the plugin settings page. This will automatically unlock your WooCommerce content whenever someone logs into their WordPress user account. They will not have to enter a separate password.

How does the Logged In Users option work?

With the Logged In Users option, your hidden WooCommerce store will be hidden from guest users. The store content will automatically appear whenever someone logs into their WordPress user account on your website.

When someone logs in, all the WooCommerce content will automatically become visible for them.

For example, if your menu contains links to your main shop page, cart, checkout, product categories or other WooCommerce pages, then these will be hidden from guests. The links will appear for logged in users so that they can navigate around your store.

How to create a login and/or registration page

If you’re using the ‘Logged In Users’ option then you will need to provide a way for people to log into their user accounts on your website. This is not part of WooCommerce Private Store and you can use any type of WordPress user login form. For example:

  • The ‘Account’ page that comes with WooCommerce itself displays a login and/or user registration form for guests. You can configure this in the general WooCommerce settings.
  • You can create a registration and/or login page using a plugin such as Theme My Login or Profile Builder.
  • You can also use the default WordPress user login page at wp-login.php. (We don’t generally recommend this because for most stores, it’s more professional to keep users on the front end which matches the rest of your website.)

You need to provide a way for people to log into your private store. Depending on the nature of your store, you may or may not wish for general visitors to know that you have a store. As a result, here are suggestions for different ways that people can find your login page:

  1. To keep your store completely hidden, you may wish to email a link to the login page directly to your private store customers. That way, people can only access the login page if they have the direct URL.
  2. You can add a store login link to anywhere else on your site, e.g. a pre-header bar at the top of the website, the sidebar, or the footer.
  3. If you wish to link to the login page from a navigation menu, then this is possible too. Please note that if you’re using the WooCommerce Account page as your login form, then WooCommerce Private Store will hide this page from the menu. This is intentional behavior because some people wish to hide this from guests. Instead, you need to go to Appearance -> Menus, click on the ‘Custom Links’ section, and add the Account page URL as a custom link. You can’t just select it from the list of Pages, as this will be hidden by WooCommerce Private Store.

WooCommerce Private Store Custom Link to Account Page

The plugin is designed to hide menu and widget links to the WooCommerce ‘My Account’ page. Please see the previous section for advice on our suggested workaround.

WooCommerce Private Store will automatically hide the WooCommerce pages (shop, products, product categories, etc.) from navigation menus for logged out users. These links will appear once someone logs into their user account.

If you wish to show/hide additional pages depending on whether someone is logged in, then we recommend the free Nav Menu Roles plugin. This works nicely with WooCommerce Private Store and gives you extra control over the visibility of each menu item.

Can users create their own account to access the private store?

Yes, you can do this using the WooCommerce Account page or a plugin such as Theme My Login. Please see our separate article with detailed instructions on how to do this.

Can I approve new users before they can access the store?

Yes, you can do this using a plugin such as New User Approve or Theme My Login. When someone registers a new account, they can’t access the private WooCommerce store until after you have approved their application and they log in for the first time.

Can I hide the password entry form?

Example store login page with password entry form hidden. We added some text and a user login shortcode from the Theme My Login plugin to the Form Message field:

You can hide the password entry form by ticking the ‘Hide the login form when the store is locked’ box on the plugin settings page. This option only appears when the ‘Automatically unlock the store for logged in users’ box is ticked. It hides the password input form and submit button from the store login page.

If you do this, then the only way to unlock the store will be to log into a user account on your website.

The Form Message from the settings page will still be shown on the store login page, or when a non-user tries to access a page in your hidden store. We recommend that you use the Form Message to provide clear instructions on how they can log into their user account. You can either do this by linking to your login page, or you can embed a login form created using a plugin such as Theme My Login or Profile Builder.

Can I show different products to different categories depending on their user role?

This is not possible, as WooCommerce Private Store simply hides your entire store. To show different WooCommerce content to different groups of people, we recommend our other plugin – WooCommerce Protected Categories – instead.

While this doesn’t integrate with WordPress user accounts, it lets you create a different password protected category for each customer or group of customers. For example, it’s very popular for creating a WooCommerce wholesale store with separate public and wholesale areas.

Can users login via URL, instead of having to enter a username and password?

If you are using the ‘Logged In Users’ option in WooCommerce Private Store then you can allow people to login URL. To do this, you need to install any WordPress plugin that allows users to login automatically by clicking on a link.

Please see our tutorial about how to set this up.

Was this article helpful?

Related Articles