How to Hide a WooCommerce Shop from Guests, so only Logged In Users can see it
We’re always adding exciting new features to our WooCommerce Private Store plugin. As well as hiding WooCommerce behind simple password protection, you can automatically hide a WooCommerce shop from guests so that only logged in users can see it.
There are lots of reasons for wanting to hide WooCommerce from people who don’t already have an account on your website.
You may have a WooCommerce wholesale store that is only available to logged in wholesalers. Maybe you’re setting up a members-only WooCommerce shop and want to hide it from non-members. Whatever your reason, you can easily hide WooCommerce from guest users using WooCommerce Private Store.
How does it work?
The new option in WooCommerce Private Store lets you tick a box to automatically unlock your shop for logged in users. If you tick this box on the settings page then it works like this:
- A guest user visits your website They can see all your main pages but none of the WooCommerce content. If you have links to the Woo shop page, categories etc. in the menu then these will be hidden from public view. Any WooCommerce sidebar widgets are hidden too. The same applies to other WooCommerce elements such as the cart. The guest user has no idea that your WooCommerce shop exists. Even if they try to access a WooCommerce page directly (e.g. if they know the URL of a product), they will be asked to enter a password.
- The user logs into their account Some visitors to your website will have an account, which they can log into. They can login using the usual WordPress/WooCommerce login page. (This might be /wp-login, the WooCommerce ‘Account’ page, or a front end login such as Theme My Login. Or if you want people to log in with their Facebook, Twitter or Google+ account, use the WordPress Social Login plugin.)
- The hidden WooCommerce shop is unlocked After logging in, all the WooCommerce content becomes visible to the user. This might include links to the main Shop page in the menu, WooCommerce widgets and all the individual pages within WooCommerce. The logged in user can browse your store and buy products with no restrictions.
How to hide a WooCommerce shop from non logged in users
If you like what I’ve described above, the good news is that it’s really easy to set up. Here’s how to do it. I have assumed that you already have a WP website with WooCommerce set up, and you’re ready to hide the WooCommerce shop from logged out visitors.
- Buy WooCommerce Private Store. Download the plugin files and license key from the order confirmation page or the email receipt.
- Log in to the WordPress admin and go to Plugins → Add New.
- Click ‘Upload’ and then ‘Browse’ and upload the plugin files you downloaded in step 1.
- Install and activate WooCommerce Private Store.
- Go to WooCommerce → Settings → Private Store. Enter your license key and configure the other plugin settings. Make sure you tick the ‘Logged In Users’ box. (You can ignore the ‘Login Form’ settings as you won’t be using password protection for your store. Instead, you will use the WordPress user login.) If you like, then you can also choose which user roles will have access.
- Click ‘Save’.
And that’s it! Your WooCommerce shop is now completely hidden from public view. Guests can see your normal web pages but none of the WooCommerce content. Once they log in to their account, the whole of WooCommerce instantly unlocked for them. Simple!
Can I hide the links to my hidden WooCommerce store?
Yes. All the links to your WooCommerce content will be hidden from logged out users (guests). This could be menu items linking to your main Shop page, categories or individual products. It could be the WC widgets listing products, categories etc. It also includes elements such as the shopping cart icon.
All WooCommerce content – and the links to it – will be hidden from guest users. As if by magic, all this hidden content will become visible when a user logs in.
Can I force users to register before they can access my WooCommerce store?
Absolutely! Use the WooCommerce Private Store plugin with the built-in ‘Account’ page or a front end registration plugin such as Theme My Login. Theme My Login has an option to moderate new registrations, or you can do this with the free New User Approve plugin. If you use this, then people will only be able to login and access your hidden store after you have approved their account.
What if I don’t want my customers to have individual user accounts?
That’s fine. The plugin also lets you hide a WooCommerce shop behind a simple password. Instead of having to log into their account, customers visit your private store login page and enter a password.
On entering a correct password, the hidden WooCommerce shop is fully unlocked for them. This includes the main WooCommerce Shop page and all your products, categories, product tags, etc. Customers can find products, add to cart and check out in the usual way.
Here’s a review from a customer using WooCommerce Private Store to create team and school stores behind a common password:
A Must for my Business
How can I hide the login page after people login?
If you use the built-in WooCommerce Account page as your register/login page, then you don’t need to worry about this. That’s because the same page will show a registration and/or login form to guests, and the ‘My Account’ area for logged in users. This makes it relevant to all types of user, whether or not they’re logged in.
If you use WooCommerce Private Store with a login plugin such as Theme My Login, then you need to structure your store in an intuitive way. Think about each step of the user journey. For example, you want to add a prominent login link for logged out users. But once people are logged in, then the login page is no longer important to them.
You can add a link to the user login page anywhere you like. For example, you can add it to the menu or header (depending on your theme). This link will be subtle, so it won’t bother logged in users. You could also ask your developer to dynamically change it to a logout link for logged in users.
If you’re using WooCommerce Private Store to hide your entire website, then you might want to set the login page as the homepage. This isn’t very user-friendly because it will still show the login page when logged in users visit the homepage – albeit with a message saying that you are logged in. Instead, set another page such as the main ‘Shop’ page as the homepage. When guest users visit the homepage, they will see a user login form. But when logged in users visit, they will see the shop page. This is a more user-friendly way to set it up.
I just want to hide parts of WooCommerce
If you want to hide parts of WooCommerce but not your whole shop then I’d recommend our other plugin, WooCommerce Password Protected Categories.
This lets you lock down specific categories within a Woo store, and the products within them. Your other categories and main Shop page remain public. This means that you can have public and hidden areas within a single WooCommerce shop.
Do you have a hidden WooCommerce shop?
Now it’s your turn.
Do you use WooCommerce Private Store or a different solution to hide a WooCommerce shop? Is it more useful to password protect WooCommerce or to hide it from users until they login? Are there any other features you would expect from a private WooCommerce plugin?
Please leave your comments below.