How to Hide a WooCommerce Store & Make It Private

Hide WooCommerce StoreLots of people ask us how to use the WooCommerce Password Protected Categories plugin to complete hide a WooCommerce store within a WordPress website. You might want a public-facing website that anyone can access, but with a private e-commerce area that only people with the password can access.

WooCommerce Password Protected Categories is most commonly used to protect one or more product categories within a public online shop. However it can equally be used to create a hidden WooCommerce store. This tutorial will teach you how to create a completely private online shop.

1. Before you start

To hide a WooCommerce store, you need a WordPress website with the WooCommerce and WooCommerce Password Protected Categories plugins installed. You also need a WooCommerce-compatible theme – I used the Storefront theme on my test site.

Once you have done this, you need to add your products in the usual way. You can also create the public pages of your website (if you’re having one) such as Home, About and Contact. This tutorial will cover the rest of the process and tell you how to make your WooCommerce store private and hidden.

At the end of the tutorial, you will know how to add a hidden WooCommerce area to your website. Your categories and products will not appear anywhere on the public part of the site. They won’t appear in the navigation menu, in sidebar widgets or on your homepage.

2. Create a main password protected category for your hidden WooCommerce store

The first step is to create a main product category for your WooCommerce store and to password protect it. By having one password protected category, you can then structure your entire online shop within this category.

  1. In the WordPress admin for your website, go to Products > Categories. This is the standard WooCommerce category page, except that you will see a ‘Visibility’ section at the bottom left when you create or edit a category. This has been added by the WooCommerce Password Protected Categories plugin.
  2. Add a new category and call it anything you like. This will be the name of your hidden WooCommerce store.
  3. Click ‘Password protected’ and enter a password. You will give this password to all the customers who can access your private online shop. (If you want each customer to have a unique password, click the + icon to add additional passwords.)
  4. Your new category will appear in the list of product categories on the right. You can see that it’s password protected in the ‘Visibility’ column.


Password protected or private category?

You’ll also see an option to mark a category as ‘Private’. This is a bit more advanced so we’re not covering it in this tutorial, but I’ll explain what it does.

The ‘Private’ option basically lets you restrict product categories available to logged in users on the appropriate level. By default, only administrators and WooCommerce Store Managers can see private categories. You can use a plugin such as User Role Editor to choose which user levels can access private categories.

You might want to explore this option if you want each user to have a unique login. However it’s a bit more work to set up as you might want to do some work on your login page etc., which is provided by WordPress and your theme.

Password protected categories is a good option for most hidden WooCommerce stores because you don’t have to manage individual logins for each user. Everyone shares the password to your private online shop and it’s nice and easy to set up.

3. Add any sub-categories

You can divide your hidden WooCommerce store into multiple categories if you like. (If not, skip ahead to step 4.)

The key point to remember is that everything in your private WooCommerce store must be within your main password protected category. You can add extra categories, but make sure you set your main category as the ‘Parent’.

  1. Create each of your sub-categories using the ‘Add new category’ option on the left of Products > Categories.
  2. Select your main password protected category as the ‘Parent’.
  3. Leave the visibility as ‘Public’. This is because the sub-category (and its products) will automatically be protected with the same password.

Once a customer enters the correct password on your main category page, it will unlock the entire WooCommerce store for them. This saves them having to re-enter the password as they navigate around your site.

Note: If you want to create separate password protected categories that are unrelated to each other, that’s fine. You might want to do this if you want to create different private areas of your shop for different customers. For example, a photographer might create a separate password protected category to sell the photos for each client. 

4. Add your products to the password protected category

Next, it’s time to put your products within the password protected categories you just created.

  1. Go to the Products section of the WordPress admin.
  2. Hover the name of each product and click the ‘Quick Edit’ link that appears.
  3. Select one or more categories and click ‘Save’.
  4. Repeat for all your other products.

When you add new products to WooCommerce in future, you will also need to assign them to your password protected categories.

WooCommerce Add Product to Category via Quick Edit

5. Link to your private WooCommerce store (optional)

Even if you are hiding your WooCommerce shop, you might still want to link to it. For example, you might want to add a link called ‘Client login’ or ‘Trade area’ to your homepage, header or footer. You might want to link to it from the navigation menu and either make it publicly visible so that anyone can access the password entry page, or set it to only appear after customers have entered the password.

Of course if you want to hide the fact that your website even has an e-commerce area, you don’t have to link to it at all. Instead, you can give your customers the link directly (e.g. via email).

How to add links to a protected WooCommerce category

  1. Go back to Products > Categories. Hover over the name of your main password protected category. Right-click the ‘View’ link and copy the link. That will put the URL/address for your hidden category to your clipboard.
  2. Now go to wherever you want to add the link – e.g. your homepage, header or footer. Create a hyperlink in the usual way (either using HTML or the ‘Insert/Edit Link’ WordPress toolbar icon).

How to link to protected categories from the menu

  1. Go to Appearance > Menus.
  2. On the left, open up the ‘Product Categories’ section.
  3. Tick whichever password protected categories you want to add to the menu.
  4. Click ‘Add to Menu’.
  5. The product categories will be added to the end of your menu on the right. Drag them to the correct position and click ‘Save Menu’.

Now go back to your website and click ‘Refresh’. If your private categories don’t appear in the menu, that’s because the plugin is set to only show them in the menu after you have unlocked the category. If you go to the main category for your hidden WooCommerce store and enter the password, the links will then appear in the menu.

6. Choose how your hidden WooCommerce categories behave

The WooCommerce Password Protected Categories plugin lets you choose how the hidden part of your store appears publicly. You can change the plugin settings as follows:

  1.  Go to WooCommerce > Settings > Products and click the ‘Password Protected Categories’ link at the top.
  2. Tick and untick the boxes to choose whether your protected categories and products appear in menus etc.
  3. This page also lets you change the text that appears above the ‘Enter password’ box and the wording of the button. For example you might add instructions on what to do if a customer loses the password.

WooCommerce Password Protected Categories Settings Page

7. Hide any global links to the WooCommerce cart

Depending on your WordPress theme, there might be publicly visible links to the cart. If you want to hide your WooCommerce store, you probably don’t want this to appear on your public website.

If you use a fully featured theme from ThemeForest or similar then the theme options might let you hide the cart icon. If your theme doesn’t have this option then you can hide it using CSS. (We recommend Codeable for small coding tasks like this). Or even better, ask your WordPress developer to code the cart link to only appear when there are products in the cart. This will automatically hide it from your public-facing store because customers can only add products to the cart after entering the password!

8. Add the WooCommerce cart widget

If you’ve hidden the main links to your cart, you can use the WooCommerce cart widget to display the cart in the sidebar. This might be the right or left hand column on your WordPress site.

  1. Go to Appearance > Widgets.
  2. Find the sidebar area where you want the cart to display.
  3. Drag the ‘WooCommerce Cart’ widget from the left hand side to the correct sidebar area.
  4. Tick the ‘Hide if cart is empty’ box in the widget settings and click ‘Save’.

By ticking ‘Hide if cart is empty’, the cart widget will only display when customers have products in their cart. Since your WooCommerce store is hidden and people can only add products after they enter the password, this stops it from appearing on your public website. Even if you have the same sidebar on the public and private areas of your website, the cart will only appear when there are products in the cart.

This means that it doesn’t matter if you have hidden the shopping cart from the header, as it appears in the sidebar instead.

How to Use WooCommerce Cart Widget

8. SEO – Hide your private WooCommerce store from search engines

Finally, a note about SEO.

I won’t cover this in-depth as it depends on your WordPress SEO plugin. As a general principle, you will want to mark all of the following as noindex:

  • All the default WooCommerce pages (Cart, Checkout, My Account and Shop).
  • The Products custom post type.
  • Product category pages.
  • Product tag pages.

If you have an XML sitemap then you need to tweak the settings to exclude.

Use the documentation for your WordPress SEO plugin to find out exactly how to do this.

This will hide the hidden areas of your WooCommerce store from search engines while allowing search engines to index your public pages.

Wrapping up

In this tutorial, we have created a hidden area of a WooCommerce store. We’ve added links to it – either to the menu or to anywhere else on your website. We’ve dynamically added the links so they only appear once people have unlocked a category. We’ve added a shopping cart widget which only appears to customers in your private store.

This lets you hide a WooCommerce store within your WordPress website.

Are you using WooCommerce Password Protected Categories to create a hidden WooCommerce online shop? I’d love to hear how you’re getting on with it – please add a comment below.