WordPress.org

Support

Private Blog

  • What’s the best way to set up a private blog, one just a few people can read?

    The best I’ve been able to come up with is password-protecting the WordPress directory, but that’s somewhat awkward.

    Thanks,
    Kevin

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’d actually like something similar. Like a public section of my site and a private section where only logged in users could see certain parts. In fact, what would be ideal is if there could be a “private” category so that when something is linked to that category, it requires a password.

    Thanks
    Kristina

    kwdavids, an example index.php (for the root of your blog, not the index.php with your theme) to get you going:

    <?php
    $siteurl = 'http://my-blog-site';

    $cookiehash = md5($siteurl);
    if(empty($_COOKIE['wordpressuser_' . $cookiehash])) :
    header('Location: '/wp-login.php');
    else :
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');
    endif;
    ?>

    Provide the same address for $siteurl as the one for the WordPress address (URI) setting in Options > General. It has to match exactly. And in the header() argument make sure ‘Location’ is correct for the path to wp-login.php. Alternatively you can point to any document (of your own devising), or display a modified login, or whatever you feel is appropriate.

    Kristina, a couple plugin options you could take a look at:

    http://blog.firetree.net/2005/08/25/viewlevel-20/
    http://gregelin.com/archives/index.php/3

    Kafkaesqui! Thanks so much. I added both plug-ins and they are doing exactly what it is that I wanted them to do 🙂

    Kristina

    That second link on gregelin.com isn’t valid anymore, what’s the best way of making most of the blog posts private while still leaving a few public ones given wordpress 2.0.4?
    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Private Blog’ is closed to new replies.
Skip to toolbar