Creating Password Protected Pages and Areas in WordPress

Buffer this pageTweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone

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

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

Weekly WordPress Tips To Your Inbox

+ Get 50% Off The Beginner's Guide to SEO Ebook!
  • This field is for validation purposes and should be left unchanged.
Buffer this pageTweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone

This Post Has 20 Comments

  1. John

    I password protected a page some time ago but have mislaid the password. How do I solve this problem?

    1. Lucy

      Just set a new password for that page.

  2. Randy M

    Is there a way to have more than one password that could be entered? With each password taking you to a different page? for setting up tier pricing?

    1. Lucy

      Hi Randy – for that type of setup, you should really be looking at a more fully featured membership plugin like MemberPress or Paid Memberships Pro.

  3. Kim Woodbridge

    Hey Lucy – Thanks for this post. I need to password protect part of a site with a single password for all users. This article and the plugin suggestions got me on the right track. I ultimately decided to make it a separate site because it’s easier to protect the single site with one password but you gave me some great ideas and helped me get my thoughts in order.

  4. Kevin

    How do you customize the Password Protected screen????

  5. Paul Farrington

    Thanks for the advice this has worked a treat on our new project

  6. Taimoor

    How can we make certain part of the post password protected?

    1. LucyBeer

      Sounds like you'll need something like the "Members" plugin by Justin Tadlock

  7. LucyBeer

    For all those that let me know that the plugin Password Protect Children Pages was out of date – thanks! I have updated the post and now recommend "Smart Passworded Pages"

  8. brennen

    any way now to kick those over to the sidebar? i want the sub pages hidden until the password in entered. but i dont want them right there on top. I cant get anything else to work.

  9. Andreas

    Hi Lucy,
    what if you have htaccess protection installed in the admin folder? I discovered that every password protected page or post asks for the username and password of the htaccess protected folder first followed by the specific password for a page or a post. Obviously wordpress make use of the login functionality even in case of a simple page/post password where no user login is required.
    Is there a plugin that can protect areas of a page or post independently from the wp "password system"? Would be great if you can share any knowledge. Thanks!

  10. Peter

    Just read your post on Creating Password Protected Pages in WP. When I found the plugin you mentioned – Password Protect Children's Pages – I got the following message: "This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress." I'm a real novice at this, so I don't want to do anything that will backfire on me. Any thoughts?

    1. Mark

      Peter – did you find an alternative to Password Protect Children's Pages? I notice you have a password protected section on your site so I am guessing you either went ahead with the unsupported plugin or found another way?

  11. Jeremy

    Hi !

    I find your blog absolutely interesting. And I aalso have a question which is a bit related to this topic so if you prefer you can answer by email directly.

    I have a blog, I created a new page for my online product and I would like to give each of my clients an access code, password. Each one of them a unique username and password to get to my product. I could manage to create a global passsword so I give the same to everyone but how can I create a different one for each of my customers ?
    I appreciate your time and help and thanks in advance.

    1. Sherissa R

      Did you find a solution for this setup?

  12. Mark

    I have a client that wants their WordPress site to have three areas. One unprotected, one for group A (dependent on permission to a Google Group A) and one for group B(dependent on permission to A Google Group B). Members will first get into A and then move to B. People who are in B can also see things that are in “A” and “B” areas but “A” folks should not be able to be able to see “B” area until they are in group B. If it is easier then B will see B only and A will see A only.

    ~M

    1. LucyBeer

      Hi Mark – Sounds like you will need a more robust membership solution. You could look at the "Members" plugin by Justin Tadlock, but you may also look at s2 Member which has even more capabilities.

  13. markus

    Hi Lucy,
    this afternoon I spent several hours checking out plugins, reading how-tos, activating and finally deactivating one after the other – until I found your page: exactly what I was looking for – works simple and clean. You made my day – thank you!

  14. Michael

    Great find – thank you!!

Leave a Reply

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