How to Password-Protect WordPress

How to Password Protect WordPress: From Single Posts to Whole Site

Want to password protect WordPress to keep your site safe from prying eyes? Whether you want to add a password to your entire WordPress site or just a specific post (or something in between), WordPress gives you the flexibility to set up access exactly how you’d like.

But for most types of password protection, you’ll need to turn to some third-party solutions to get your password protection set up. So to help you find the right solution for your exact situation, I’ll run through a few different tutorials showing you the various ways in which you can add password-protected areas in WordPress.

By the end of this post, you’ll know how to add password protection to:

  • Your entire WordPress site
  • A specific category
  • An individual post or page
  • Specific WooCommerce products or categories of products

Let’s dig in…

How to Password Protect Your Entire WordPress Site

To password protect your entire WordPress site, you’ll need the help of a thiry-party WordPress plugin. But don’t worry… it’s 100% free! So this method won’t cost you a penny.

There are a few plugins out there that can help you out. But personally, I like one called Password Protected because it’s popular and easy to use.

To use it, get started by installing and activating the plugin. Then, head to Settings → Password Protected to configure it.

It’s really simple. First, you need to choose whether or not to enable password protection in the Password Protected Status box.

Then, in Protected Permissions, you can choose to allow certain types of users access to your site without needing a password. So if, for example, you’re logged into your Admin account, you don’t need to enter a password as long as you’re already logged in.

Then, in New Password, enter the password you want to use to allow people to access your site.

And finally, in Allow IP Addresses, you can choose to exclude specific IP addresses from needing to enter a password. That is, if you enter an IP address here, anyone with that IP address can access your site without the password:

Password Protect

Now, if anyone tries to access your site, they’ll see a screen like this:

Password Login Screen

This screen pulls its styling from your WordPress login page. So if you use a plugin to customize the regular WordPress login page’s look, those style changes will carry over to this page.

Just be aware – while the plugin does restrict access to your main WordPress site, if someone has access to a direct link to a specific file or image hosted on your server, they’ll still be able to access that file directly (though not the post that contains that file or image).

How to Password Protect a Specific WordPress Category

If you’d like to restrict access to a specific WordPress category instead of your entire WordPress site, you’ll need to use a different plugin to get the job done. This time, you can turn to a plugin named Access Category Password.

Once you’ve installed and activated the plugin, head to Settings → Access Category Password to configure the plugin.

Start by entering The password. This is the password users will use to access your password-protected categories.

Then, select the categories you want to password protect in Impacted categories:

Access Category Password

Scrolling down a little further, you can choose to grant certain user roles access without needing to enter a password in the Granting users option.

If you want to still display excerpts without needing a password, you can check the Only single post box. When you check this box, users will still see the excerpt in your blog archive page. But if they try to click to see the entire post, they’ll need to enter the password. If you leave the box unchecked, users will need to enter a password to see any content… even on the blog archive page.

The rest of the options deal with the text displayed on the Enter password form. You can customize the text if you’d like. But otherwise, you’re totally free to leave these settings as the defaults:

Plugin Defaults

Once you’ve got everything configured, anyone who tries to access a post in one of the restricted categories will see a prompt to enter the password:

Remember – you can customize the text on this form and add CSS styling from the plugin’s settings menu:

Customize form and CSS Styling

All password protected categories will use the same password, though. If you’d like to set up unique passwords for each category, you might want to look at the premium Password Protected Categories plugin from Barn2 Media.

How to Password Protect WooCommerce Products or Categories

Unfortunately, I haven’t been able to round up a free plugin to help you protect categories of WooCommerce products. Which is a shame, because this is a helpful way to create a private wholesale store (or any other type of private store).

But Barn2 Media has released a WooCommerce-specific version of their password plugin that allows you to create password protected WooCommerce categories with some other nifty features.

I’ve personally used it in the past and, while it’s not free, it does get the job done for $75.

If you’re just looking to password protect a single WooCommerce product, you don’t need to pay for the plugin, though. The same method I’ll outline in the next section also works for password protecting single WooCommerce products.

How to Password Protect Individual WordPress Posts or Pages

Did you know that WordPress actually has a built-in tool to password protect individual posts and pages? It’s in the core software, but most people are completely unaware that it exists. And here’s the really cool thing:

You can actually use this feature to password-protect multiple posts at once. If you give more than one post the exact same password, visitors will only need to enter the password once to access all posts with that password. It’s a nifty little trick that gives you some flexibility in between password-protecting individual pieces of content and whole categories.

Here’s how easy it is to add a password to any piece of WordPress content…

When you’re in the normal WordPress Editor, go over to the Publish box and find the Visibility option:

How to password protect wordpress single post

Click Edit and choose the Password protected option. Then, enter your desired password:

Enter desired password.

Then, Publish or Update your post like normal. If anyone tries to access the post, they’ll be prompted with this message:

Password-Protected Area

As I mentioned above, you can also use this method on WooCommerce products or most other custom post types.

Just remember – once a visitor enters the password once, they’ll get access to all posts that use that same password. No need for your visitors to keep entering the same password over and over.

Wrapping Things Up

Whether you need to restrict one lonely post or your entire WordPress site, one of the options here should have you covered. Additionally, if you want to go even further with access controls, you may be better off just going with a dedicated membership site plugin for more features.

While this is overkill if you just want basic password protection, it’s a good option if you’re trying to set up a dedicated private area for members. For a lightweight plugin to get you started on a more structured private area, WP Customer Area is a good option.

This post may contain affiliate links, which means Nimbus Themes may receive compensation if you make a purchase using these links.

Written exclusively for

Nimbus Themes Publishing Logo

About the Author

Colin Newcomer is a freelance blogger for hire with a background in SEO and affiliate marketing. He helps clients grow their web visibility by writing primarily about digital marketing, WordPress, and B2B topics.

Read all posts

Leave a Reply

Your email address will not be published. Required fields are marked *