Website Building » WooCommerce » How Do You Hide a WooCommerce Shop From Guests So Only Logged in Users Can See It?

How Do You Hide a WooCommerce Shop From Guests So Only Logged in Users Can See It?

Last updated on January 12, 2023 @ 7:14 pm

If you’re running a WooCommerce store, there might be times when you want to hide it from guests and only allow logged in users to see it. Maybe you’re selling products that are only for members or you’re running a private sale.

Whatever the reason, there are a few ways you can go about hiding your shop.

One way to do this is by using the WooCommerce Members Only plugin. This plugin lets you restrict access to your WooCommerce shop by making it members only.

To do this, you just need to install and activate the plugin, then go to the Members Only settings page and select which user roles should have access to the shop. You can also add a message that will be displayed to users who don’t have access.

If you don’t want to use a plugin, then you can also add some code to your .htaccess file. This will protect your entire WooCommerce folder so that only logged in users can access it. Just add the following code to your .htaccess file:

<IfModule mod_authz_core.c>
<Files wp-content/plugins/woocommerce/>
Require all denied
</Files>
</IfModule>
PRO TIP: If you are planning to hide your WooCommerce shop from guests, please be aware that this could have negative consequences for your business. Guests may not be able to see your products or checkout if they are not logged in, which could lead to lost sales. Additionally, hiding your shop from guests could make it more difficult for new customers to find and purchase your products.

Replace wp-content/plugins/woocommerce/ with the path to your WooCommerce folder. If you’re not sure what this is, then you can find it by going to your WordPress Dashboard and going to Settings > Permalinks.

The path will be listed under Optional. Once you’ve added this code, save your .htaccess file and upload it back to your server.

So there you have it! Two ways that you can hide your WooCommerce shop from guests.

Morgan Bash

Morgan Bash

Technology enthusiast and Co-Founder of Women Coders SF.