• My brother is building a site using wordpress as his CMS. He’s a freelance magazine writer and has been placing some portfolio content in a couple of private, password protected pages.

    When he submits an article request, he includes the link to the relative portfolio page along with the password. But unfortunately, this hasn’t worked out as smoothly as planned as some of the editors have been having trouble remembering or type in the password.

    What would be ideal is a way (plug-in, built-in fuction, etc) that would allow him to send a link that incorporates either the page’s password or some other encoded key based on the password. That way the editors can simply click on the link and he can periodically change the page’s password, rending those links invalid.

    I’ve been digging through the plugin database all weekend, trying to find a solution for him, and come up empty handed.

    Does anyone know of a plugin or process that would accomplish this?

    Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • I don’t know of any plugin which can do that but it could certainly be achieved.
    Pu this in your theme’s header.php before any other code

    <?php if(is_single()&amp;&amp;have_posts()){
    the_post();
    $pass = get_post_meta($post->ID, 'password', $single = true);
    if(empty($pass)or(isset($_GET['password'])&amp;&amp;$_GET['password']==$pass)){
    rewind_posts();
    }
    else{
    wp_die('This post needs a valid password.', 'Incorrect Password');
    }
    }
    ?>

    To password protect any page create a new custom field with a key of password and a value of the password of you choosing. The link is then https://site.com/2009/04/hello-world/?password=value
    The password can be changed when necessary.

    This is a bit simple but its the best I could come up with in the time, if you want a proper plugin you will have to hire me!

    Thread Starter aliensplicer

    (@aliensplicer)

    Thanks, although plugin would be the slick way to handle it, this method should work just as well. I’ll let you know what my brother says.

    I’m looking for something very similar, but I don’t think this is quite it…

    This looks like the password HAS to be in the url. What I want is the page, as linked from my website, to behave normally – i.e. when the user clicks the link to a protected page, the user is given a password prompt… However, I want to be able to email out direct links that will bypass that password prompt…

    The idea is that I have a “Home Movies” page on my blog. I want the page password protected as I don’t want strangers seeing them. Close friends and family know the password, so they can go to my site, click the link, and enter the password. Sometimes though, I post something to the page that I want a particular family member to see and so I want to email them the link… but I don’t want them to have to bother entering a password. When they use the direct link I send them, they should get right in.

    Does anyone have a solution that would work?

    I figured out a solution and posted here

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘links to password protected (private) pages’ is closed to new replies.