How to Make an Entire WordPress Blog Private

string(14) "attribute >>>>" array(0) { }

Sometimes you just want to have a blog that only you and a select group have access to, with no crazy bells and whistles.

I’m not releasing this as a plugin because it’s so darn simple but you can pretty much just copy and paste the following code into a folder within your plugins directory and then activate it under ‘Plugins’.

Anyone not logged in is directed to the login page.

Plugin Name: Tumble Coyote
Plugin URI:
Description: Protects the Tumble Cave
Author: Tumble Design
Author URI:
/* =Setup
 * -------------------------------------------------*/
 class Coy{
 function Coy(){
 function protect(){
 if((!(current_user_can('read')) && (strpos($_SERVER['REQUEST_URI'], 'wp-login.php') === false))){
 $coy = new Coy();

/* =Hooks
 * -------------------------------------------------*/
 add_action('init', array(&$coy, 'protect'));
  • Leave a Comment

  • reese spykerman

    thank you, Nicky!

  • Nicky Hajal

    So glad to help, Reese!

  • SAngRoXx

    thanks mann!