How to Password Protect Posts in WordPress
The great thing about WordPress is that it’s so easy to publish content. For bloggers, this is a huge advantage. 15 years ago, if you didn’t know how to code, you were basically out of luck, unless you could invest in someone who knew how. Even then, to publish a post, you had to work on their schedule. With WordPress, after your post is written, publishing takes less than a second.
Think about Password Protection
That being said, there are a number of reasons you may not want your post read by absolutely everybody. Most people would love for a wider audience, but if you’re writing about something personal or want to post anonymously and are afraid you might be found out, it makes sense to protect your writing.
Fortunately, you can do this with WordPress by insisting that anyone who wishes to read your post must first enter a password. This is another great example of WordPress simplifying things for the average user. Before, you’d need either pricey software or that coder we mentioned earlier. Now, just do the following.
Unless you password protect a post, WordPress will make it public. When you’re on the admin dashboard, find where it says “Visibility.” Currently, it should say, “Public.”
However, you have two other options to choose from, depending on what kind of people you want to provide access. There’s “Password protected” and “Private.”
One that is password protected will only be accessible to readers with the right password. They will be prompted to enter it when they try reading the post, but WordPress cookies will then make it available to them immediately in the future, unless you change the password or its visibility to “private.”
A private post is visible to literally just you or someone you’ve made an administrator or an editor. People often do this when they have writers on their blog, but don’t want to publish their content until someone has first had a chance to read it over and make changes. In either case, WordPress will allow you to create the password, which has a limit of 20 characters.
Setting a Password
Go under the Visibility section and click “Edit” or “Quick Edit.” This is where you’ll go to make your password, change it when necessary or simply retrieve it if you forgot what it was (it’s different from your admin or editor password, so logging in wouldn’t be a problem).
How Passwords Affect Your Display
WordPress will alter the display of your post a couple of ways when they are password protected. The Title will still be visible, but will have “Protected” at the end.
The content will be completely hidden though and will instead show a message that reads:
"There is no excerpt because this is a protected post."
Where the reader would otherwise find your content, they will now find a prompt for the password. A similar text will say:
"This post is password protected. To view it, please enter your password below:"
Thanks to WordPress’ built-in functionality, it’s simple to keep your thoughts safe from public consumption and limit it to only those people you trust the most.