How to Hide a WooCommerce Shop from Guests, so only Logged In Users can see it

By Updated: July 30, 2019 4

WooCommerce Private Store Plugin We’re always adding exciting new features to our WooCommerce Private Store plugin. As well as hiding a WooCommerce shop 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.

WooCommerce Private Store

Hide a WooCommerce shop on your site today!

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:

  1. 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.
  2. 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.)
  3. 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.

  1. Buy WooCommerce Private Store. Download the plugin files and license key from the order confirmation page or the email receipt.
  2. Log in to the WordPress admin and go to Plugins → Add New.
  3. Click ‘Upload’ and then ‘Browse’ and upload the plugin files you downloaded in step 1.
  4. Install and activate WooCommerce Private Store.
  5. 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.)
  6. Click ‘Save’.

Hide WooCommerce Shop From Logged Out Users

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!

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:

Review about WooCommerce Private Store Plugin

WooCommerce Private Store

Hide a WooCommerce shop on your site today!

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.

See also: How to Build a Private WooCommerce Members Only 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.

Katie Keith

An active member of the global WordPress community, Barn2 Co-Founder Katie loves collaborating with other plugin companies. Her articles have been published on high profile sites including WPTavern, Torque and IndieHackers. She oversees all plugin support and deals with 'Tier 2' support requests about how to use Barn2's plugins in advanced ways.

4 Comments

  1. Kurt
    August 25, 2018 Reply

    I'd like to hide my store, showing it only to users that login--I'll create the user registrations and email the details to each of my wholesale clients. But I would also like to be able to broadcast a "generic" user id and password to prospective wholesale clients that they can use to view the wholesale info--without the ability to change the generic user's address or other account details. Do you have a solution for this?

    • Katie Keith
      August 25, 2018 Reply

      Hi Kurt, the easiest way to do this is to use the password protection that comes with WooCommerce Private Store. You can create one or more passwords that let people unlock the store without needing individual user accounts; and you can also set it up so that it automatically unlocks for logged in users. Use both of these options together to provide individual user logins for your wholesale clients, with a shared password that you can given to prospective wholesale clients who don't have user accounts.

  2. Devesh
    August 21, 2017 Reply

    Can you please help me with woocommerce product limitation in which we can make only 1 item available for once for all the users.
    I will try to make it more clear - suppose A person buys x item. Now this x item should not be available for any other A,B,C....Z users!
    Can you help me regarding this?

    • Katie Keith
      August 22, 2017 Reply

      Hi, WooCommerce comes with its own built-in stock control, so you can set the stock for each product to 1. Once someone buys it, no one else will be able tod.

Please share your thoughts...

Your email address will not be published.