Put code below into your theme’s functions.php
:
add_action( 'template_redirect', function() {
is_user_logged_in() || auth_redirect();
});
function fpw_custom_login_message() {
$message="<p style="text-align: center">Until this site goes public you need to be registered to see the content<br /> </p>";
return $message;
}
add_filter('login_message', 'fpw_custom_login_message');