A couple clients recently needed some basic password protection for a selected group of WordPress pages. I thought “Great, WordPress already has that built in”, which it does, but with one drawback. Password protection when used in WordPress only applies to the page that it was setup on.
Now, like anything in life, there are usually a number of ways to accomplish any given task and this is no different. We could simply password protect every page using the same password. This wouldn’t require any special code or plugin, but the user experience would be pretty crappy. Every time they went to a new page they had not already unlocked they would have to re-enter the password. That would bug the crap out of me.
You would think this would be pretty easy to accomplish, and it actually is. The plugin FT Password Protect Children Pages can be downloaded from the WordPress plugin repository and it does exactly what it says. Simply install the plugin and activate it and all children pages of a password protected page will also have their content hidden behind a password input. It also works so that if a user has already entered the password they will not be forced to re-enter it again when viewing another child page. This alleviates the gross example we outlined in the previous paragraph.
Download FT Password Protect Children Pages
This plugin has not been updated in over 6 years. Yikes! That is usually an immediate red flag when deciding to install and activate a plugin, but in this case I decided to go ahead and use it for two main reasons. One, it is a nice simple option that works exactly as you want it to. Two, the plugin consists of one small file of PHP in order to accomplish what it needs to. Just because a file is small does not mean that the code cannot be exploited or will work forever, but it isn’t doing a ton behind the scenes and that makes me feel more comfortable.
At the time of this posting I have used the most recent version of the plugin (v0.3) on two separate WordPress installs running 4.5.1 without any negative side effects. Your mileage could vary of course.
Also published on Medium.