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.:
- Password protection (the default) – Customers must enter a password onto the store login page to unlock the hidden WooCommerce store.
- 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. By default, the store content will automatically appear whenever someone logs into their WordPress user account on your website. You can fine-tune this by selecting which logged in user roles can access the store.
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 (or users with the correct role) 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 the Account page that comes with WooCommerce itself (which displays a register/login form to logged out users), or 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.)
Can I hide the password entry form or redirect it to the login page?
You can use the ‘Logged In Users’ option with or without a separate password protection option. For example, you might want people with user accounts to unlock the store by logging in, while also offering basic password protection for people without individual user accounts.
If you want to disable the password protection option completely (e.g. because all your customers have individual user accounts), then you can do this 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 ‘Page title’ and ‘Message’ fields on the Private Store settings page will still be shown wherever you have added the
[store_login] shortcode, or when a non-user tries to access a page in your hidden store. It’s not possible to automatically forward this to the user login page because these pages are generated automatically when someone tries to view a page that they don’t have access to. Instead, we recommend rewriting these fields to explain that the user must login first, and link to your user login page. You can see an example of this in the screenshot above.
Tip: If you’re not using the password protection option in WooCommerce Private Store, then we don’t recommend using the
[store_login] shortcode for your login page. Instead, use the instructions in the next section to direct people to your user login page.
How to add registration/login links to your public 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:
- 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.
- 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.
- 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 has hidden the link to my login 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.
Can I show/hide specific menu links to logged in/logged out users?
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?
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 show different products to different categories depending on their user role?
You can choose which user roles can access the private store. However, all logged in users with these roles will be able to access your entire store.
If you want to show different WooCommerce products to different user roles, we recommend our other plugin – WooCommerce Protected Categories – instead. This offers more fine-grained control, including the ability to choose which users and roles can access each product category in your store. For example, WooCommerce Protected Categories is very popular for creating a WooCommerce wholesale store with separate public and wholesale areas.
You can use WooCommerce Protected Categories as well as WooCommerce Protected Categories if you want to hide your entire store from public view, with different categories for different users or roles.
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.