Last Updated: February 25, 2016
·
1.026K
· Kresimir Pendic

Make Wordpress visible to only logged in users

To make some site that is publicly available on,, for ex: address:

http://example.com

only visible to admin roles or developers while working on site online, open your index.php in your active theme and somewhere on the top of that file add next line:

<?php  
if( ! is_user_logged_in() ) exit ;
// rest of the theme calls..
get_header();
// ...

after that, only logged in user will see developement site, and all others, including web crawlers will see beautiful white canvas :)

cheers, k