Password Protect Your WordPress Website - 02

From A to Z: How to Password Protect Different Areas of Your WordPress Site

There may be times when you want to limit access to certain areas or all of your WordPress website without creating a membership site. The solution is password protection! 

Unlike membership sites, password protection doesn’t require users to sign up and log in. They only need a password to unlock and access the protected content.

Not only can you protect an entire website, but you can also make it partly private, partly public. In fact, there are seven areas on your site that you can restrict access. This article walks you through the use cases as well as the solutions to password protect each WordPress area:

We just launched 6 FREE Beaver Builder courses. Learn how to easily build WordPress websites with step-by-step video tutorials. Get started today.

7 Different Ways to Password Protect Your WordPress Site

#1 Password Protect Pages and Posts

You may want to secure certain premium content for:

  • Internal communication – When sharing internal projects within a company, you can create multiple password-protected pages accessible to only the employees across different departments.
  • Paid privilege – Private pages such as “thank you” and “downloads” shouldn’t be available for anyone but your subscribers and customers. Only those with the right permissions will be able to view these pages.

It’s easy to password protect individual WordPress posts and pages. You can use either WordPress default visibility or install a plugin to password protect your content.

Setting WordPress Visibility

When a post is published, it’s automatically set to “public” visibility. To password protect the content:

  1. Find the Visibility setting at the top right corner of the post and hit Edit.
  2. Change the post status from Public to Password protected.
  3. Enter a password to protect that page.
  4. Finally, click OK.

WordPress Password Protect Settings

Unfortunately, the built-in feature allows you to set passwords to individual posts and pages only. This will take you a lot of time when you want to secure many posts at the same time. 

Install Password Protect WordPress Pro

With Password Protect WordPress Pro, you’ll be able to set the same password to protect multiple pages at the same time. It’s straightforward to get started using the plugin. After activating Password Protect WordPress Pro, follow these three simple steps to password protect your content:

  1. Head to the page or post you want to password protect
  2. Click on Password protect
  3. Enter a password to protect the page or post

Install Password Protect Plugin

The plugin also comes with some other awesome automation features. For example, when you protect a parent page with a password, all child-pages under it will be automatically secured as well.

Password Protect WordPress also supports protecting a post with multiple passwords. You can provide each user with a different password and track how many times a password is used.

#2 Password Protect Part of the Content

Instead of password protecting entire posts and pages, you may want to lock just a part of your content with a password. In other words, you can make certain sections or paragraphs public while password protecting other sections or paragraphs. Visitors will have to provide the correct password to view the part of the page or post that you protected. 

Partial password protection sparks interest in the hidden content. You can then ask visitors to subscribe or pay to get the password, unlock the content, and read the complete article.

For example, in this article, we could have shown you two methods to password protect your WordPress content but hidden the other five methods under a password protected form. If our content is interesting enough, chances are you’ll subscribe to read the entire content.

How to password protect part of your content

Use the Passster – Password Protection plugin to partially protect your content. You can follow the steps below:

  1. Install and activate the plugin.
  2. Go to the Settings page, generate a password, save changes, and copy the shortcode.
  3. Go to your WordPress dashboard, click on Posts/Pages.
  4. Open the WordPress editor of the post or page you want to partially password protect.
  5. In the page builder tab, add the shortcode you’ve copied to the text that needs password protecting.
  6. Click on the Add Content Protector shortcode button in your Editor if you want to make any changes on the Cookie Expiration Time.
  7. Click Insert.

passter plugin

Now, visitors will be able to read the public section of your article only. The private content inside the shortcode will be hidden under a password form.

#3 Password Protect Post Categories & Sub-pages

Whereas site-wide password protection restricts public access to all pages and posts, setting a password to post categories and sub-page allows you to shield related posts and pages of your site content.

Once a category or a parent page is password protected, all posts under that category or sub-pages will be secured too. So, you can:

  • Hide all the content related to a topic – For example, perhaps you have an eCommerce website selling different products and services. Now you want to discontinue one as it hasn’t generated a lot of revenue. All you have to do is disable the main product’s documentation. The rest of sub-products’ documentation will be restricted automatically so that your customers won’t get confused.
  • Protect all related premium content – Let’s say you have a series of in-depth articles about a particular topic that you don’t want publicly accessible. You can assign a password to lock the category so that all articles under it will be protected.

How to password protect posts categories automatically

Access Category Password plugin offers an effective method to password protect WordPress categories. After installing this plugin, select Access Category Password under Settings in your WordPress dashboard. 

Then you will see a list of the following setting options: 

  • Password – The password that users need to enter to view your protected category. 
  • Impacted categories – Select which existing categories on your website that you intend to restrict access to.
  • Granting users – Choose user roles who are able to access the protected categories without filling the password form.
  • Info message – Display a customizable info message before the password form of the protected category.

access-category-setting

access-category-password-settings

Once changes are saved, users will see a password form whenever accessing any posts under those restricted categories.

#4 Password Protect Individual WooCommerce Products

WooCommerce is a powerful tool to build e-commerce stores quickly. It allows you to sell both physical and digital products as well as manage inventory and shipping.

There are different reasons that you may want to restrict access to your WooCommerce products with a password, such as:

  • To sell customer-specific products. Maybe some products are produced and sold to only a specific type of customer.  An example of this is selling products to employees.
  • To encourage visitors to become members. You can use passwords to completely hide products that are available only to subscribers. Any people who want to buy these products have to subscribe to get the password. 

How to password protect individual WooCommerce products

Similar to password protecting WordPress posts and pages, you can use the built-in feature to secure individual products.

  1. Go to the WooCommerce product page that you want to password protect.
  2. In the Publish box, click on Edit next to Visibility.
  3. Select Password protected.
  4. Enter your password, then click Update or Publish (in case the product hasn’t been published yet).

Despite being password protected, your products will still be shown on your Shop page and category pages. Customers have to enter the right password to add it to their shopping carts.

The drawback is that the customers must fill passwords in the forms every time they want to buy any protected products. Unfortunately, this isn’t user-friendly. Instead, set the same password for multiple product pages for a better user experience. Then customers will need to enter the password only once to access all other protected products.

#5 Password Protect WooCommerce Categories

Instead of wasting a lot of time password protecting products individually, you may want to group them into a category and protect that product category. For instance, let’s say you’re selling clothes and want to hide all red shirts since they’re not available at the moment. Securing posts related to red shirts with a password helps prevent the general public from viewing and purchasing them.

How to password protect WooCommerce categories

The WooCommerce Password Protected Categories plugin locks product categories with passwords. All attempts to access any products in the protected category will be restricted. Customers have to enter the right password to see and buy private products.

The following steps show you how to password protect a WooCommerce category with the WooCommerce Password Protected Categories plugin:

  1. Go to WooCommerce → Products in the left navigation bar of your WordPress dashboard.
  2. Click on Categories to create a new category then provide a name and a slug.
  3. In the Visibility settings section below, select the Password Protected option.
  4. Enter a password.

In case you want to password protect an existing category, follow these simple steps:

  1. Choose the product category you want to password protect.
  2. Click on Password Protected option in the Visibility settings section. 
  3. Enter a password.

As soon as you password protect a category, all subcategories and posts will be automatically secured. So, when customers enter the correct password to the private category, they will gain access to all the posts that belong to that category.

You can create multiple passwords for each category as well. Under the Visibility section, click on the plus icon to add a new password or the minus icon remove an existing one.

woo password protected categories

Another notable feature is Whitelist roles. You may set which user roles – such as admins or editors – can view product categories without entering the password.

#6 Password Protect WooCommerce Stores

Password protecting entire WooCommerce stores proves effective in various scenarios, such as: 

  • Private client areas. Case in point, you have a B2B company and want only authorized clients to be able to access your store. For example, wholesalers who sell manufactured products and don’t want their goods to be publicly available. They can give retailers passwords to view and buy their products.
  • Website maintenance mode. You want to put your store on hold for a while so that you can freely edit or make adjustments to it.
  • Age-restricted store. You sell adult products or services such as tobacco and alcohol, which shouldn’t be accessible to underage visitors. Locking the WooCommerce store helps in this scenario.

How to password protect WooCommerce stores

WordPress doesn’t have any built-in options to password protect the whole WooCommerce shop. Thanks to the WooCommerce Private Store plugin from Barn2 Media, you can do so with just a few set-ups. It helps hide all the shops within your WooCommerce site except the homepage and blog. WooCommerce-related widgets are also hidden.

To password protect your WooCommerce store with WooCommerce Private Store plugin, you’ll need to:

  1. Go to WooCommerce in your dashboard.
  2. Find Settings and click the tab Private Store.

Once installed, input the license key under the Settings page to access its premium features.

Password Expiration Time allows users to access your store without re-entering the password. On top of that, you can also customize page titles, messages, password labels, and the login button.

Woo Private Store Plugin Settings

#7 Password Protect Entire Sites

Site-wide password protection comes in useful in many cases. For example:

  • Websites under development – While developing a WordPress site, you may not want unauthorized visitors to access it. You can use a password to hide the site before launch. Only those with the correct passcode, such as the development team and the editors, are able to access your private site content.
  • Personal websites – A password also helps secure your personal website where you keep private content, such as family photos or personal journal writing. You can share the content with your friends and relatives only.

How to lock an entire WordPress site

To enable password protection to your whole WordPress site, you can use cPanel’s password protected directories tool as follows:

  1. Head to Security section in your cPanel
  2. Click on the Password Protection Directories folder
  3. Add a username and password to protect a directory

cpanel's password protected directories

cPanel's password protection form

Once configured, an authentication prompt will display when users access any pages of your website. Only those with the right username and password are able to view the website.

Password Protect Your WordPress Site Areas

Password protection provides an easy and useful solution to keep your WordPress content invisible to the public. You can protect different areas on the website, from a single post to the whole site, or even files in posts. There are plenty of options!

While you can use the WordPress built-in feature to lock posts, pages, and individual products with a password, you should install a plugin to password protect sub-pages, categories, partial content areas, and entire websites. A plugin like Password Protect WordPress Pro is one of the best ways to easily secure your WordPress site content with a password! 

Wrapping Up

Please let us know in the comment section below if you have any questions about how to password protect your WordPress site areas.

About Anthony Tran

Anthony Tran is the Marketing Director for Beaver Builder. Before working with the company he managed a WordPress web design agency. He loves Starbucks iced coffee, watching NBA basketball, and catching the latest blockbuster movie.

5 Comments

  1. Alice on October 2, 2019 at 2:04 am

    Thanks for the ultimate guide. I have researched the plugins you recommend and find out that the Password Protect WordPress Pro plugin can help lock the entire site too. Instead of password protecting the directory to the secure the whole site, this is a good plugin to try.



  2. Gilles on May 29, 2020 at 10:44 am

    Hello there, good Job!
    Do you know if it’s possible to add a class to a protected post in the wp menu?
    To add a padlock in css for exemple…
    Thak’s and stay safe.



  3. Asad on July 28, 2020 at 5:08 pm

    Is there any way to lock the woocommerce dashboard, but still let them create products/categories etc? I want someone to be able to fully edit and design my website, but not let them see the woocommerce area



  4. Huy Doan on June 25, 2021 at 9:41 pm

    Is there a way to password protect a table created with the Table Module? I tried Passster but could not get it to work. Thank you.



Our Newsletter

Our newsletter is personally written and sent out about once a month. It's not the least bit annoying or spammy.
We promise.

Try Beaver Builder Today

It would be totally gnaw-some if you could share this post with your friends.

Related articles

Best WordPress Black Friday deals

Best WordPress Black Friday Deals (2024)

Hey Beaver Builders! Are you looking for the best WordPress deals for this holiday season and Black Friday? We reached…

Read More...
Spotlight on 48in48 | Beaver Builder nonprofit website builder

48in48 Spotlight: Beaver Builder’s Nonprofit Website Builder

For the past ten years, Beaver Builder has been the go-to nonprofit website builder for 48in48. This incredible initiative brings…

Read More...
Bento Grid Design with Beaver Builder's Box Module

Bento Grid Design in WordPress with Beaver Builder’s Box Module

The Bento Grid Design seamlessly combines clean lines, balanced proportions, and intuitive organization, drawing inspiration from Japanese bento boxes. Beaver...

Read More...

Join the community

We're here for you

There's a thriving community of builders and we'd love for you to join us. Come by and show off a project, network, or ask a question.

Since 2014

Build Your Website in Minutes, Not Months

Join Over 1 Million+ Websites Powered By Beaver Builder.