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:
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:
- Find the Visibility setting at the top right corner of the post and hit Edit.
- Change the post status from Public to Password protected.
- Enter a password to protect that page.
- Finally, click OK.
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:
- Head to the page or post you want to password protect
- Click on Password protect
- Enter a password to protect the page or post
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:
- Install and activate the plugin.
- Go to the Settings page, generate a password, save changes, and copy the shortcode.
- Go to your WordPress dashboard, click on Posts/Pages.
- Open the WordPress editor of the post or page you want to partially password protect.
- In the page builder tab, add the shortcode you’ve copied to the text that needs password protecting.
- Click on the Add Content Protector shortcode button in your Editor if you want to make any changes on the Cookie Expiration Time.
- Click Insert.
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.
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.
- Go to the WooCommerce product page that you want to password protect.
- In the Publish box, click on Edit next to Visibility.
- Select Password protected.
- 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:
- Go to WooCommerce → Products in the left navigation bar of your WordPress dashboard.
- Click on Categories to create a new category then provide a name and a slug.
- In the Visibility settings section below, select the Password Protected option.
- Enter a password.
In case you want to password protect an existing category, follow these simple steps:
- Choose the product category you want to password protect.
- Click on Password Protected option in the Visibility settings section.
- 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.
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:
- Go to WooCommerce in your dashboard.
- 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.
#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:
- Head to Security section in your cPanel
- Click on the Password Protection Directories folder
- Add a username and password to protect a directory
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!
Please let us know in the comment section below if you have any questions about how to password protect your WordPress site areas.
How to Display an Instagram Feed in WordPress (In 4 Steps)
Since WordPress discontinued oEmbeds in 2020, you’re not able to insert your Instagram feed into content simply by pasting a…
Top 10 Web Design Trends (What Makes a Great Website in 2023?)
As a web designer, you want every website you create to be a great one. This is easier said than…
How to Export and Import Pages in WordPress
By default, WordPress has built-in tools for exporting and importing your entire website or just your posts and pages. Fortunately,…
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.
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.
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.
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
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.
Hi there, I think you may be referring to a Table Module found in a Beaver Builder add-on such as UABB? This plugin may be what you are looking for: https://passwordprotectwp.com/docs/protect-partial-content-page-builders/ Hope this helps!