Many online store owners need to serve different types of customers from the same storefront, but how do you hide products from one group while displaying them to another? Learn how to hide products by user roles in WooCommerce.
The online marketplace is vast and complex, so your store may have to cater to diverse customer needs. Wholesale customers vs. retailers, members vs. non-members, there are many cases where you will want to hide certain products from specific types of users.
Many store owners would benefit from doing this based on user roles but don't know how. In this article, I will discuss the benefits of hiding products based on user roles and walk you through how to get it done in your store.
Understanding the need for product visibility by user role in WooCommerce
User roles are an essential part of WordPress because they determine who can do what on your website. WordPress needs to make sure that only you can access and edit the site from the backend, which is why it automatically assigns you the role of admin from the start. Everyone else who visits the site has no way of viewing the dashboard, creating posts, or changing content.
There are other types of roles you can introduce to your ecommerce store, some by default and others through WooCommerce plugins. User roles give you more control over your store.
While WordPress user roles are normally used to control who can access the back end of the site, they are equally useful for restricting access to front end content. For example, you can use them to hide categories and their product pages from certain types of users. There are many reasons you might want to do this, including but not limited to the following use cases:
- Displaying different products and prices for wholesalers. Hiding a product by user role is the most straightforward way to go about this.
- You might want to create a members-only section of your site that only subscribers can access.
- If you provide a highly personalized product or service, you may want to create a hidden page for each individual client that only they can access.
You don't want customers to be bombarded by content that is irrelevant to them, so strategically hiding things can also boost the user experience on your site.
Benefits of hiding products based on user role
There are a number of ways in which selectively hiding parts of your site will benefit your WooCommerce store.
Firstly, users hate to be overloaded with information. Hiding products based on user role is a direct way to declutter your webpage and streamline the user experience. It's true that customers love choice and variety, but in many cases, it's possible to rule out certain products for certain people.
It also gives you a chance for some targeted marketing. If you know which products certain user groups tend to buy, you'll be able to identify other products that would interest them. This allows you to control what users see based on their preferences.
If you sell customizable products, you can create custom order pages tailored to specific users. This will allow you to display useful information to them, such as lead times, detailed product tables, and more.
Online shopping can be a deeply impersonal experience. Displaying different products by user role is one way to make your customers feel catered to. It creates a sense of exclusivity that makes your store that much more alluring.
Lastly, it prevents easily avoidable mistakes. A customer will never order something from the wrong section of your store if they can't access or even see that section in the first place.
Choosing user roles for hiding products
When it comes to hiding products by user role in WooCommerce, there is no one-size-fits-all solution. Which strategy you should use depends in great measure on your business model and the type of store you're running.
Here are some things to consider when choosing user roles:
- The nature of your product or service will have a large impact on the number and types of user roles you will need.
- Who should be able to see your product pages? you can make them accessible to any number of people based on roles, from one individual to a large, well-defined group.
- Your marketing strategy should affect your choice of roles. Are you casting the net wide or going for a laser-focused approach?
Remember to keep your user roles as simple as possible. You shouldn't complicate things by adding user roles for their own sake. You should employ them only to solve specific problems or improve your website's products and services. In most cases, your store should lean towards global visibility settings. With that in mind, here are a few examples:
- You run a bakery that sells to individual customers as well as local restaurants. You give the restaurant owners a login that gives them access to a hidden part of your site where they can order in bulk and see different prices.
- You're a wedding videographer that provides a fully tailored service. You create a private page for each client where you upload clips, walk them through the editing process, and keep them up to date on their video.
- You sell hazardous or restricted materials. Only users with verified accounts can access the relevant product pages and make purchases.
Next, I'll tell you how to hide products by user role - either using the default WordPress user roles, or custom roles which you create.
Setting up WooCommerce product visibility by user roles
Once you've purchased WooCommerce Protected Categories, it's simple and straightforward to change product visibility by user role. Here is a step-by-step guide to hiding specific products by user role for WooCommerce:
Step 1: Download and install the plugin
Get the plugin and download it to your computer. To install it onto your website, go to your WordPress dashboard. On the left-hand menu, go to Plugins. Next, click Add New, then Upload Plugin, and Choose File. Select the .zip file you just downloaded and click Install Now. Once the upload is complete, click Activate.
The setup wizard will prompt you for a license key which was sent to you via email.
Step 2: Create custom user roles with User Role Editor
Skip this step if you're happy restricting products to the default roles which come with WordPress itself.
By default, you can't create new, specific user roles, but you can use a free plugin such as User Role Editor to do so. Once you've installed the free version of this plugin, navigate to your dashboard again. Click on Users, then User Role Editor and Add Role.
This plugin creates new roles by 'duplicating' existing roles which you can then rename. Duplicate the Subscriber role and give it whatever name you choose.
Don't worry about the rest of the general settings on User Role Editor, we'll be finishing the job with WooCommerce Protected Categories.
Further reading: 5 best free plugins to extend WordPress user roles and capabilities.
Step 3: Create a new protected category
Now that we have our new user roles, we can start hiding products from whichever group we choose. We do this by making a 'protected category' with our new plugin. First, return to the dashboard, mouse over Products, and click Categories.
Pick a new name for your new category, then scroll down to the new section marked Visibility. Here, you have three options for category visibility. Click the checkbox box marked Protected. Since we want to hide our WooCommerce products by user role, we check the box marked User Roles. You will now be prompted to select which user roles to show products from the category to. The plugin will automatically hide the category and its products from all the user roles you exclude here.
Note: Once you reach this stage, you can also restrict product categories by individual user, or lock it behind a password of your choice! Logged-in users will automatically be able to see any hidden content that they have permission to access.
All that's left to do is add all of the desired products into your newly created protected category. Navigate back to your dashboard and click on Products. Find all of the products you want to hide, click on quick edit, and add them to your protected category on the right-hand side of the screen.
If you like, you can even add a specific category to your store's drop-down menu. Only those with access to the protected category will be able to see it there. It will be hidden from other user roles and guest users.
SEO optimization while managing product visibility
It's important to keep in mind that tampering with the visibility options in your store will affect your SEO ranking. The effects can be good or bad depending on the efficiency of your setup. Take note of the following best practices to optimize your SEO.
First of all, every page that you hide will not be detectable by web crawlers. There's no point in filling these product pages with keywords and fine-tuning them for search engines because their content won't affect the rankings in the slightest. Therefore, you shouldn't ever hide a product page unless the benefits outweigh the potential loss.
Never hide WooCommerce products by user roles if there is a direct link to your public site. For example, if a user tries to navigate to a shop page that looks to be accessible via your site's menu only to get an error screen, they will likely click away. The navigability of your site has a huge impact on user experience, and studies have shown that a poor layout will increase the bounce rate.
Useful, relevant information is great for SEO. If you have a shop page with any general information, make sure you don't lock it behind a private category.
Snippets from your hidden pages won't affect your SEO rankings per se, but if users interact with those pages, it does boost SEO. Therefore, hiding the wrong products will worsen your SEO, but displaying the right products to the right user roles will boost your SEO.
When you keep users away from product pages that don't interest or apply to them, it reduces the bounce rate and makes their experience more enjoyable. People are attracted to content that is tailored to them and repelled by irrelevant clutter.
Hidden products also create a sense of exclusivity that keeps customers interested and drives them to spend more time on your web page.
Take action and hide products by user roles with WooCommerce Protected Categories
User roles allow you to categorize your customers easily into specific groups, large or small. This means that hiding pages by user role is an extremely efficient means of managing catalog visibility for your whole store.
There are a great many advantages to hiding pages by user role, including:
- Prevent ordering mistakes. Hiding pages from some user roles will stop customers from navigating to the wrong parts of your site, reducing confusion at the checkout and return rates.
- Give your products an air of exclusivity. Customers are sure to pay more attention when they feel as though they have access to something hidden or special.
- Create private spaces for clients with custom work.
- Boost user experience and keep your website tidy and organized.
WordPress frequently lacks in-built features that are useful, or even necessary for WooCommerce store owners. There is no default option for hiding products or categories by user role. Thankfully, Protected Categories is the best WooCommerce hide products plugin and fills in the gap nicely.
As your store becomes more complex, hosts greater numbers of products, and attracts more visitors, it will become more difficult to manage and optimize. WooCommerce Protected Categories lets you expand your range of products while keeping your store streamlined and catering to your customers. Click the link below to download the plugin today and get started!