WPLift is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission.

Keep Your Content Private: A Step-by-Step Guide to Password Protecting a Category in WordPress

Last Updated on September 13th, 2023

Tags: ,

You created a website to make your content available to the world…but that doesn’t necessarily mean you want the world to see everything on your site. So, if you want to restrict some of your content from the public, what can you do? 

Today, we will discuss different methods you can use to hide your content. That way, you can ensure a password is protecting specific categories on your WordPress site.

With Barn2 Media’s Password Protected Categories plugin, you can password-protect entire categories on your site. And you’re not just limited to the normal WordPress taxonomies – you can restrict any type of hierarchical taxonomy created by custom post types.

Then, to grant access, you can give your visitor a password, and have them automatically sent to the category associated with that password upon logging in.

Sounds interesting? Join us as we look deeper into the Password Protected Categories from Barn2 Media.

What Are Some Reasons to Password Protect Categories on WordPress?

Because Password Protected Categories lets you restrict categories for any custom post type used on your site, you have a ton of flexibility in how you use it.

Almost every plugin that creates a new type of content for your WordPress site uses custom post types, which means you can restrict anything that uses categories.

Here are some nifty ways in which you can use Password Protected Categories:

  • Categories of blog postsOK, this is the most obvious one. But there are plenty of reasons you might want to do this.
  • Portfolio categories Maybe you don’t want to make your full portfolio public. With this method, you can give potential clients a password to access a specific category of hidden items. Or, you could even hide your entire portfolio from the public.
  • Event categoriesYou can restrict whole categories of events from various popular plugins like Events Calendar Pro, Events Manager, Event Espresso, and any other plugin that uses hierarchical categories for events.
  • Easy Digital Downloads categories – Need to make some categories of products private? No problem!
  • Other eCommerce plugins – Same idea as Easy Digital Downloads (EDD). It’s no problem. Barn2 Media even has dedicated plugins for woocommerce password-protected categories.
  • Podcast categoriesWant to make some podcast categories private? Easy peasy!
  • Real estate listings – You could move rented apartments to a private category, and then move them back to public when they’re available again. Besides this, you can make private listings for only qualified parties.

And remember, you’re by no means limited to just these uses. You can password-protect literally anything that uses categories.

Article Continues Below

Password Protecting a WordPress Website without a Plugin

We would like to clarify that installing a plugin isn’t the only way to hide the contents of a WordPress website. The complexity of this task will depend on the method you choose. 

You can either create password-protected categories from the WordPress dashboard, or use HTTP Authentication to hide an entire site.

Neither method is a sustainable solution for subscription or eCommerce sites. Still, they can be an excellent alternative, if you don’t want to add another plugin to your site. 

Creating a Category Password with WordPress

The fastest way to create password-protected categories is to use WordPress’ native features. The Visibility option lets you restrict access to all types of categories, add multiple passwords to a single category, or define user roles and how much content each user can see. 

Follow the steps below to set a category password

  • Go to the Dashboard and open the Posts menu.
  • Find the Category submenu and click the Category option.
  • You’ll see the Visibility section at the bottom of the Category page.
  • Make sure the Password Protected option is selected, and choose how many passwords you want the category to have. 

Alternatively, you can adjust the Visibility settings from the WordPress editor, where you can select the password users must provide to view a specific post, page, or product. Moreover, you can allow visitors to access multiple posts with the same password. 

WordPress will generate a login page after you activate the Password Protected option, so don’t forget to personalize the generic text on the login page before hitting the Publish button. 

Restricting Website Access with HTTP Authentication 

This method is suitable for websites that are still under development. HTTP Authentication is a mechanism servers use to request login information from website visitors. 

Hence, the steps you’ll need to take to activate this option will depend on the hosting service.  Setting up HTTP Authentication is usually simple, as you just have to enable password protection from your hosting account, and specify the Username and Password.

A login popup appears on the screen whenever a visitor attempts to access a website if the HTTP Authentication was properly set up. 

Article Continues Below

Apache and Nginx enable you to password-protect a folder, but you should first reach out to the hosting service’s customer support before attempting to assign a password to a directory.

Hands On With Password-Protected Categories

Despite its flexibility, the plugin is straightforward to set up. Once you activate it, you can set up how password protected categories function by going to Settings → Protected Categories.

Literally, all you need to do is:

  • Choose which page you want people to log in to categories from. You can also grab a shortcode version, if you’d like.
  • Customize your login form button and message.
  • Choose whether to allow protected categories to still show up in search results, menus, etc. Once a user enters the password, protected categories will automatically show up in search results and menus – this setting only applies to people who haven’t already entered a password.
  • Choose how long visitors can access the password-protected category after logging in.

set up password protect category plugin in wordpress

Then, on your category login page, visitors will see something like this:

category login page preview in wordpress

If you want to customize the page further, you can use the shortcode for more flexibility. That way, you can add additional text above/below. Or, you could even stick the shortcode into a page builder to build a more feature-rich login page.

How to Password Protect Categories

You’ll actually password-protect categories on the Category page. For example, to password-protect a blog category, you’d go to Posts → Categories.

Then, at the bottom of the form, you’ll see a new Visibility box that allows you to password-protect categories, as well as make categories private (available only to Admin and Editor user roles). You can even add multiple passwords for the same category:

password protection to a specific category

Article Continues Below

Note – the password is linked to that specific category. So, someone who logs in with the password for that category will automatically be directed to that specific category. Because you can password-protect multiple categories, this lets you do something like:

  • If a visitor enters passwordA, take them to Category A.
  • If a visitor enters passwordB, take them to Category B.

With that being said, when a user enters a password, they’ll automatically gain access to all subcategories of the category (if applicable). So, keep that in mind as you build your password structure.

Does it Really Work With Custom Post Types?

Okay, we’ve said the plugin works with any custom post type. But that doesn’t mean we didn’t want to make sure that’s actually the case!

To test it, we whipped up a quick custom post type called Test Post Type. Then, we added a Test Taxonomy taxonomy to that post type. And, when we went to add a new category to my Test Taxonomy taxonomy, we confirmed that the plugin does indeed work as promised:

password protect category plugin for custom post types

What About Search Engines? Will They Index Protected Categories?

Nope! Password Protected Categories automatically adds a noindex tag to both password-protected categories, as well as all of the individual posts contained in that category.

That means Google won’t be sending people to password-protected pages, which is a good thing for your site’s user experience.

How Much Does Password Protected Categories Cost?

Password Protected Categories costs $59. With that, you get one year of support and updates for one website.

One thing to note is that Barn2 Media operates on automatic billing. So, after your first year of support and updates, your subscription will automatically renew for another year of support and updates unless you cancel. Of course, you won’t lose access to the plugin if you cancel – you just won’t get any new updates.

Barn2 Media is very transparent about this – We just think it’s worth reiterating.

What About Support?

As you probably gleaned from the hands-on screenshots, the plugin is pretty easy to use. But if you need help, Barn2 Media has detailed support docs for all their plugins. You also get that one year of dedicated support if you run into something that’s not in the support docs.

What are the Alternatives to the Password Protected Categories Plugin? 

You can use many plugins to password-protect protect WooCommerce category or any other category instead of the Password Protected Categories plugin. 

In most cases, you can choose between a free version of the plugin with limited functionalities and the Premium version that includes all the plugin’s features. Here are a few of my favorite password protection plugins for WordPress: 

  • WPShield Content Protector – The plugin features 15 modules that allow you to prevent visitors from downloading images from your website or protect your site’s copy. 
  • Access Category Password –  Besides setting a password for the content in a specific category, you can use this plugin to choose an authentication method or create a custom message displayed after the visitor provides the wrong login credentials.

Frequently Asked Questions about Password Protecting Categories in WordPress

Can I Password Protect a Category in WordPress?

Yes, you can set one or more passwords for each category you create on a WordPress website. Hence, you can control who can see products in a WooCommerce category or require visitors to log in if they want to listen to your latest podcast. 

The password protection option applies to all category types, and you can use it for custom posts, individual pages, or different types of products. Moreover, you can use HTTP Authentication on your hosting service to restrict access to your website. 

How Do I Restrict Categories in WordPress? 

Creating a password for a content category in WordPress takes only a few moments. Visibility is one of WP’s built-in features, so there’s no need to install a plugin

You can access this option from the WordPress Classic editor, or by navigating to the Category submenu of the Posts menu. To restrict a category, you must enable the Password Protected option, and then proceed to set the password visitors must use to view content in that category. It’s worth noting that users have access to all subcategories within a certain category after they log in.

Final Thoughts

Password Protected Categories does everything it promised. It lets you:

  • Password-protect categories for any post type.
  • Make categories private for any post type.

It’s simple to set up, and only takes a few minutes to get started with. So, if you find yourself needing this specific functionality, it’s a simple option that works properly out of the box.

Go to Password Protected Categories

A team of WordPress experts that love to test out new WordPress related software, WordPress plugins and WordPress themes.