Support » Fixing WordPress » How to password protect page and all subpages easily…

  • Long time WordPress user. I just ran into this issue developing a site for a client, so I figured I’d save someone else the time figuring out how to do this.

    I used this plugin:

    The limitation is that only the immediate child pages are protected. In my case I had several layers of pages and subpages, and I wanted everything to be password-protected.

    So, based on this ( I edited the plugin code:

    // This function prints the password form if the parent page is password protected. It is called whenever 'the_content' is invoked.
    function ft_password_protect_children_page_contents( $org_content ){
    	if ( is_page() ){
    		global $post;
    $ancestors = end($post->ancestors);
    		if ( !empty($ancestors) ){
    			if ( post_password_required( $ancestors ) ) {
    				$real_post = $post;
    				$post = $ancestors;
    				echo get_the_password_form();
    				$post = $real_post;
    	return $org_content;

    Seems to work perfectly. Now all I do is put a password on a page, and all its subpages are protected with the same password. Makes it easy to password protect an entire section of your blog.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thanks,
    I’ve applied this update and a couple others to the plugin. I’ll be submitting it to the repository shortly.

    Hmmm thank you 🙂
    I want my blog be limited blog. And i want only some member who know the password open it.

    I posted on an issue I was having with this particular plugin elsewhere; I’ve not received a response, though I hope I either figure it out or someone has a suggestion to that problem.

    My question is this: is it possible to set up the password protected pages to have multiple passwords (i.e. a different password for each user to access the pages) instead of one password for multiple users to access the pages?

    I see this question being asked all over these support forums and so it isn’t just me wanting a chunk of pages password protected and available to “subscribers” with their own unique password. Any thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to password protect page and all subpages easily…’ is closed to new replies.