Creating Password Protected Pages and Areas in WordPress

creating-password-protected-pages-and-areas-in-wordpress

Creating Private, Password Protected Sections on Your WordPress Site

I had a client recently who needed to create private, password-protected sections on her WordPress site. She wanted each of her clients to have a private page with information related to what they were working on together. Easy! Password-protection is an in-built feature of WordPress, in case you didn’t know.

When creating a page, you simply click “Edit” next to Visibility in the Publish box on the right. Choose “Password protected” and set the password as you choose.

Create a password protected page in WordPress

But what if you want to create a series of pages for the same client to access? Even if you set the same password for each one, it would be cumbersome to have your client have to re-enter it to see each page in their section.

WordPress actually handles this by default. If you have multiple pages with the same password, the user will only have to enter the password once, and not for subsequent pages with the same password.

So the next question is, how to provide an easy way for your client to navigate the private area you have created for them?

A simple solution I found is courtesy of the List Pages Shortcode plugin. As the name suggests, by placing a shortcode in any page or post, it will display a list of your pages.

If you were to use the basic shortcode:
[list-pages]

you would display a list of ALL your pages. Of course you only want to display the pages for that particular client or section.

So instead use the shortcode:
[list-pages child_of=”11″]

where “11” is the ID of the parent page.

An easy way to find the ID is to look at the URL when on the edit screen for the page:
find the page ID

As an example I created a main/Parent page for Client A, with 2 subpages. The parent page is the “login” page with very little besides the list of pages on it.

Client login page

 


This page will function as a “login” page for the client:
smart passworded pages

The child pages also have the basic navigation for convenience:

list pages shortcode

 

 

And the result is a simple way for my client to navigate their private section on my site:

child_page_navigation

 

In addition to private client pages, what else might you use this for on your site?

This method isn’t a solution for creating membership sites where you want to sell access to content, for example. For that type of more complex setup, you’ll need a fully-featured membership plugin, like MemberPress or Paid Memberships Pro.

Memberpress - WordPress membership plugin
Read the guide on Getting Started with MemberPress
Would you like to show custom content on your password protected page? See this guide
Read this if you want to password protect your entire WordPress site

*header image courtesy: http://www.flickr.com/photos/holster/195031415/