Private Site Plugin for WordPress

Sometimes, you may have a site that you want to be viewed by only logged in users. Especially if it’s some type of internal tool used by a private company or group. I recently needed to this on a site I was using to test out some themes, so I thought I would share it in case someone out there needed something similar.
It’s not a very complicated plugin but it gets the job done.
Here’s the code:

is_login() ) {
			wp_redirect( admin_url() );
			exit;
		}
	}
	public function is_login() {
    	return in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) );
    }
}
$bavotasan_private = new Bavotasan_Private;

You can download it through the link below.

Share this:

Email
Facebook
Twitter
Pinterest
Pocket

Premium Themes for WordPress

Looking for an easy-to-use Premium Theme for WordPress? Check out Themes by bavotasan.com and have your site up and running in no time.

Use this WordPress website builder to build powerful websites in no time for your or your clients.

WordPress Hosting

WP Engine – designed from the ground-up to support and enhance the workflow of web designers.

Bluehost – providing quality web hosting solutions since 1996.

About the author

Picture of Luke Perrie

Luke Perrie