New! Restrict WordPress categories by role or user

How to Use the WooCommerce Protected Categories WordPress Plugin - User, Role & Password Protection

We've just released version 2.0 of Password Protected Categories. Now you can restrict WordPress categories by role or user, as well as creating password protected categories.

Our WordPress Password Protected Categories plugin was originally released in 2017. Since then, it has become a popular way of hiding areas within a WordPress site. Customers love how easy it is to set up, especially compared to the complexities of most WordPress membership plugins. It's the perfect way to add simple membership to WordPress.

However, until today, the plugin only provided one way to hide WordPress content: password protection. Password protection is great because you can create multiple passwords and give them to anyone, even if they don't have an account on your website. However, some of our users want their hidden content to integrate with WordPress user accounts.

After all, if someone already has an account then they don't want to enter a separate password to unlock the hidden content. They simply want to log into their WordPress user account and automatically have access to the hidden categories.

You can do all this with Password Protected Categories version 2.0.

Restrict categories by user role

There are lots of reasons why you might want to automatically unlock certain categories for logged in users based on their role. For example:

  • If you're using password protected categories then it's a pain for administrators to have to enter the password to view the category. Now you can bypass this by automatically unlocking your password protected categories for administrators.
  • If you're creating a hidden blog for your company, then you might want a dedicated 'Staff' category. This can be visible to logged in users with a 'Staff' role, and hidden from regular users.

It's easy to restrict categories to one or more user roles. Simply install Password Protected Categories, head to the Add/Edit Category page, and choose which roles can access each category.

Restrict categories to individual users

Lots of people use password protected categories to display user-specific information. Until now, the only way to do this was to create a separate password protected category for each user. To access their hidden products, people had to visit the category page (or a central category login page) and enter the password. They would then be directed to a page listing their hidden pages or posts.

This option has always been popular, but it didn't meet everyone's needs. For example, some of our customers don't like asking customers to enter a password to unlock their protected category, and then have to enter a separate username and password to log into their user account at the checkout. Some people want a more secure option that ties in with WordPress user accounts.

You can do this with Password Protected Categories 2.0. Just go to the Add/Edit Category screen and choose one or more users who can access the category.

Mix and match protection options

Now there are 3 ways to protect a WordPress category: password protection, user or role restriction. You can use each of these on their own, or you can mix and match them as needed.

For example, a category can be password protected AND set to automatically unlock for a specific user role. Logged out users will see the password entry form; whereas logged in users with the correct role will be able to access it without having to enter a password.

Sub-categories and their contents automatically inherit the protection rules of the parent category. Please note that to avoid conflicts, each post should only be in one protected category.

Choose what happens when logged out users try to access a protected category

Password Protected Categories has always had an option to show or hide protected categories and their contents from the public parts of your store.

We've added 3 options to control what happens when a logged out user tries to view a category that is restricted to specific roles or users:

  • Show 404 error - The customer sees a 404 error, so it looks as if the hidden page doesn't exist.
  • WordPress login page - Redirect logged out users to the default WordPress login page (/wp-login.php).
  • Show custom page - Redirect logged out users to any page on your website, e.g. a front end login page; or a 'Members Only' page which explains that the page is protected and includes a signup form encouraging them to join.

Example use cases

Ok, so now you know about the new ways of creating hidden WordPress categories. There are options for you whether you want basic password protection, or to unlock hidden content based on user role or individual user account.

Before we finish, let's look at some examples of why you might want to hide categories in your WordPress site. The possibilities are endless because Password Protected Categories works with pages, posts and all custom post types.

  • Protect parts of a blog - create one or more hidden blog categories that only specific people can see. Unlock the categories with a basic password, or for specific logged in users or roles.
  • Hidden area for posting online courses/training videos - instead of creating a complex Learning Management System (e.g with a WordPress LMS plugin), use Password Protected Categories to create a hidden area for training resources. Unlock it for staff members with a certain user role and post tutoring materials securely.
  • Create an intranet with internal resources and documentation. Ideally, combine it with Document Library Pro for a complete document management solution.
  • Show different content to different people - save time compared to installing a WordPress membership plugin and create hidden areas for certain users or roles.
  • Display case studies - Create a password protected portfolio without worrying about your clients' confidentiality.
  • Create hidden client areas - Lots of companies need a WordPress client portal with a hidden area of documents and information for each client.
  • Share photos online - Whether you're a photographer or a family worried about the privacy implications of Facebook, Password Protected Categories offers a secure way to share photos. Simply add the photos to a page or post in a hidden WordPress category and restrict it based on role or user.

How to update

Existing customers with a valid license key can get the new features for free - just update the plugin in the WordPress admin.

Otherwise, get the plugin today and start creating password protected, user and role protected categories in WordPress. It only takes a few minutes to set up so you'll be up and running in no time!

Please share your thoughts...

Your email address will not be published. Required fields are marked *