Decided to lock a page on your WordPress website? We’re sure you have a good reason or else you would unnecessarily lose page views and deprive your viewers of quality content. Before we show you how to password protect a page in WordPress, know this. The default method doesn’t protect your images from being copied (or any files, for that matter) if the visitor has direct URL access. Also, the page will still be indexed by search engines, and appear around your website. To prevent this, you’ll need separate plugins (method 2) or lines of PHP code. With that said, here are 2 simple ways to password protect a page in WordPress:
1. Default way to add password protection to a page in WordPress
Follow these steps to password protect a page in WordPress directly:
To password protect a page using WordPress Classic Editor, do this:
- Access the WordPress Admin Section.
- In the menu on the left, click on Pages, then All Pages.
- Click on Edit below the name of the page you want to edit.
- In the top right corner (by default), find the box titled Publish.
- Find an option titled Visibility: Public (default value again) and click on Edit.
- Click on the empty circle in front of the Password protected option.
- Enter a password for your page. It is limited to 20 characters.
- Click on OK below.
- Click the Publish or Update button.
Gutenberg Editor/Block Editor
Adding password protection in Block Editor on WordPress works like this:
- Steps 1 through 3 are identical.
- In the top left right corner, click on the gearbox (cogwheel icon).
- You’ll see Visibility Public (default values). Click on Public.
- Select Password Protected in the pop-up window.
- Enter a password that is 20 characters at a maximum.
- Click anywhere outside of the pop-up window.
- Click on Publish or Update when ready.
2. Password protect a page using a WordPress plugin
Here are the things the default method lacks. That way, you will know whether it’s sufficient for your needs or not.
Benefits of using a dedicated WordPress Plugin
Installing a WordPress plugin can add features you might need:
- One-click password protection
- Choose multiple-password for one WordPress page
- Delegate passwords by user types
- Protect certain parts of a public post or page using shortcode
- Put a password on the entire WordPress site
- Add CAPTCHA to prevent bots
- Choose a time when a page requires a password
- Add a master password to unlock all protected pages at once
- Hide password-protected content or show excerpts of it to tease visitors
How to add password protection to a page via a WordPress plugin
You can use any of the plugins in the WordPress plugin database. We’re using a popular one to demonstrate the process. To password protect a page in WordPress with a PPWP plugin, follow these steps:
- Download Password Protect WordPress (PPWP) or search for it through the WordPress Admin Section.
- Based on the method you chose, install the WordPress plugin through Dashboard or via FTP.
- Go to Pages > All Pages in the main WordPress menu.
- Find the page you want to protect, and in the Password Protection row, click on Password protect.
- Click on the Password protect this page button.
- A password will be automatically generated and displayed.
- You can change it by clicking on Edit (pen and paper icon in the right corner), but you don’t have to. Feel free to play around with other page options.
These two things will also happen:
- A Password Protect WordPress meta box will appear in both Classic and Block Editor modes, allowing for the same functionality as above.
- An option titled Password Protect WordPress will appear in the main WordPress menu on the left. This allows you to configure global settings for the plugin, such as cookie expiration, search engine indexing block, the message that appears to the visitors, automatic child page password protection, etc.