Need to add password protected areas in WordPress? Sometimes you don’t want to make everything on your site public, and that’s totally ok! A password allows you to restrict access to either your whole site or just specific parts of your site.
In this post, I’ll give you solutions for everything from password protecting a single WordPress post, to whole categories, to your entire WordPress site.
What I won’t focus on is more complex situations like membership sites. While creating a membership site does involve needing to add password protected areas in WordPress, we already have a post on how to create a membership site.
So, let’s get started with some of the non-membership site ways to password protect WordPress content.
How to Password Protect a Single WordPress Post
Let’s start at the beginning with how to restrict a single WordPress post. This is the simplest one because it doesn’t actually require any external tools. Yes, there’s actually a built-in function to password protect individual WordPress posts.
Despite using WordPress for 10+ years, it took me surprisingly long to figure out that this function existed. Maybe it’s the same for you!
To password protect a WordPress post or page, all you need to do is go to Visibility in the WordPress Editor and click the Edit button:
Then, just select the Password protected radio button and enter your desired password. Then click OK:
Once you Publish or Update your post, your post is now password protected. What does that mean?
Well, whenever someone tries to access that post on the front-end, they’ll see this warning. Here’s what it looks like using Divi:
If your visitor enters the correct password, they’ll see the post like normal. If they don’t have the password, though, there’s no way for them to get in.
Next question – can you use this method with content that you build with the Divi Builder? Yup! It functions exactly the same no matter whether you create your content with the normal WordPress Editor or with the Divi Builder. So feel free to use this method for any single post or page that you want to password protect.
How to Password Protect a Whole Category of WordPress Posts
Ok, let’s say password protecting a single post just isn’t cutting it. It’s not enough password protection! You need to, say, password protect an entire WordPress category…
No problem! You can do it. But now, you’ll need to turn to a third-party plugin. I’ll give you a quick tutorial using a free plugin. But then, because the plugin isn’t super popular, I’ll point you to a premium plugin that I’ve personally tested in case you want a bit more peace of mind.
To password protect WordPress categories for free, you can use a plugin called Access Category Password. Install and activate the plugin, then head to Settings → Access Category Password.
The plugin is pretty intuitive to configure. Begin by choosing your password. Then, choose which categories you want to apply the password to.
You can also choose to grant certain user roles access to the category without a password – so if you, say, check the Administrator box, anyone with an Administrator account won’t need to enter a password.
And another nice feature is that you can choose whether or not to only restrict the single post template. If you check that box, you can still display excerpts on your blog post listing page – people just won’t be able to view the full post without a password:
At the bottom, you can also configure the various messages people see on the password page.
Once you save your settings, anyone trying to access a post in a restricted category should see this:
But if they go to a post without restriction, everything will work like normal.
Note – if you don’t like how the form is styled, the plugin also makes it super easy to add custom styling:
And again, for the million dollar question, does this plugin play nice with the Divi Builder? Let’s find out…Yup! Tested and confirmed that this plugin works with the Divi Builder!
If you want more flexibility – say, to use different passwords for different categories, you can use a premium plugin from Barn2 Media called Password Protected Categories. It costs $55, but it’s much more flexible in its functionality. I got a free copy to play around with and can confirm that it’s pretty neat!
How to Password Protect Your Entire WordPress Site
We hit single posts and categories, so now let’s go the whole way. Here’s how you can restrict access to your entire WordPress site using a password.
For this use, you’ll again need a third-party plugin. I recommend the free Password Protected plugin. It seems to be the most popular solution at the WordPress.org directory. To use it, get started by installing and activating the plugin.
Then, head on over to Settings → Password Protected to configure the plugin.
There’s not much to do. First off, you can choose whether or not to actually enable your password protection.
Then, you can give Protected Permissions. If you check one of those boxes, those people will not need to enter a password (and you can also enable/disable RSS feeds).
Finally, you can also choose your actual password and whitelist certain IP addresses to not need a password:
Once you click Save Changes, your site should officially be restricted. Now, if anyone who isn’t whitelisted by their user role or IP address tries to access your site, they’ll see a big ‘ole password screen:
If you want to change the WordPress logo to your own site’s logo, that’s pretty simple to do. The plugin pulls the same logo used on your regular WordPress login page. So you can either change that logo manually or use a simple plugin like WP Custom Admin Login Page Logo.
Additionally, because this plugin works sitewide, there’s no danger of any compatibility issues with Divi.
Taking Password Protection Even Further
So there’s your quick primer to creating password protected areas in WordPress for:
- Single posts or pages
- Entire categories
- Your whole WordPress site
But obviously password protection can get a lot more complicated if you want it to.
We have a guide on how to restrict only partial post content, and you can always use one of those aforementioned membership plugins to get very granular control over who has access to every single part of your WordPress site.
Now over to you – do you password protect WordPress content? And if so, how do you use password protection on your WordPress site?
Article thumbnail image by RedlineVector / shutterstock.com
The post How to Set Up Password Protected Site Areas in WordPress appeared first on Elegant Themes Blog.