Need to password protect your WordPress page or post? If you need to password protect your whole WordPress website or few pages and posts, in this post we will share some quick methods to WordPress password protect page or post.
When you want to ensure that only selected people can access your WordPress page or whole WordPress website, the answer is to password protect WordPress.
In this tutorial, we will make it simple for you to password protect WordPress page or password protect WordPress site.
We will be covering how to utilize the built-in password protection functionality of WordPress along with some of the popular WordPress password protect plugins.
WordPress password protected pages and posts allow you to hide content from the user unless they have the password to reveal the content. This functionality can be very useful for scenarios like member sites or when you want to make posts or pages for certain audience.
How you password protects WordPress depends on the nature of your website, what you want to hide from users and what your users can access.
Once you finish this tutorial, you will have a full understanding of:
- How to Password Protect Entire WordPress Website
- How to Password Protect a WordPress Category
- How to Password Protect a Single WordPress Post or Page
- How to Password Protect Selected Part of a WordPress Post or Page
So, let’s get started.
How to Password Protect Entire WordPress Website
You may want to protect your whole WordPress website from visitors while allowing certain people to view it if your website is in redesigning or development process, or because of your website’s undergoing maintenance. If you want to password protect only certain pages or posts then you can Password Protect a Single WordPress Post or Page.
Common scenarios when you want to password protect entire WordPress website are:
- You only want to allow certain people to see your website.
- Your website is in development mode and not available for general public.
- Your website is under maintenance mode.
To achieve all above, you will need a third-party plugin called Password Protected.
WordPress Password Protect Plugin: Password Protected
To get started, we need to install this plugin and activate it.
Navigate to Plugins menu from your WordPress dashboard and open Installed Plugins page. Click Add New.
Search for password protected in the search bar and locate Password Protected plugin in results.
Click on Install Now button and after installation click on Activate to activate this plugin.
Navigate to Settings menu from WordPress dashboard and click on Password Protected to access the Password Protected settings.
Check the box next to Password Protected Status to enable the password protection.
Check Allow Administrator and Allow Logged In Users in the Protected Permission section.
Lastly, you have to type in your chosen password in the New Password fields and click Save changes.
After following all above steps, anyone who will visit your website will be presented with the login page like below.
The visitor needs to enter the password you have setup in above steps, to access your website.
How to Password Protect a WordPress Category
If you don’t want to add a password on the entire website, you can protect the categories so no one will be able to access your categories. For password protect a WordPress category, I will be using Access Category Password plugin which is Free to use.
Install and activate the plugin as we did in the last section. Then head to Settings -> Access Category Password page from your dashboard.
This plugin comes with pretty simple settings to configure. Firstly enter your password, then simply choose which categories you want to be password protected.
You can also grant access to password protected categories to certain users roles like Administrator. Check that box in the settings page to grant access to categories without a password.
You can explore more settings on this page like changing the default messages which will be shown on the website to visitors as well as password protection form’s styling.
Once you have setup everything, try to access a post in the restricted category. You will be prompted with a password page like below.
How to Password Protect a Single WordPress Post or Page
WordPress password protects page or post is the simplest form of protection in WordPress. You don’t have to install any third-party plugin as this functionality is already built in WordPress.
To protect a WordPress post or page, simply edit the post you want to protect with a password. Go to Visibility section and click on Edit.
You will get some options after clicking on Edit button like below.
Select Password Protected radio button and enter the desired password. Then click OK.
Once you Update your post, your post or page will be password protected.
If you now try to access the post on your website, you will be prompted for the password like below.
If your visitors enter the correct password, they will be able to see the post or page. If they don’t enter a correct password there is no way they can access your post or page.
How to Password Protect Selected Part of a WordPress Post or Page
What about if you want to password protect a part of your post or page? For this functionality, we have to turn back to third-party plugin to add extra functionality.
This time we will use Passster plugin. The Passster plugin allows users to password protect a portion or part of a post or page. Passster will add a shortcode which you can use within your content by wrapping the selected content inside the shortcode.
Head back to your Plugins page and click on Add New to add a new plugin.
Enter Passster in the search bar and click on Install.
When installation finish, click on Activate button to activate this plugin.
After installing this plugin, head back to Posts page and edit a post you want to add password protected section. You will see Add Content Protector shortcode button within WordPress’s editor toolbar area like below.
Click on that and you will be prompted with a modal window for shortcode like below. Add your password and click on Insert button.
After adding the shortcode Passster will insert a shortcode into your editor like below.
Save / Update your post or page and visit on your website. Vistors will be able to see all content but anything you put inside the shortcode will be password protected like below.
As you can see there are several ways to protect your content on WordPress. Depending on your needs, you can decide which method is right for you.
If you have any other questions about how to password protect WordPress, leave them in the comments and we’ll try to help you out!