0

I am trying to come up with a way that I can put a WOrdPress site live on it;s final server for a client and have the site hidden from public.

It would show a dummy placeholder page to all visitor unless they enter a password or have a cookie set or IP matching...you get the idea.

So only a group of allowed people would view the live site and others would see a placeholder landing page while the site was being worked on.

Any ideas on a god easy solution?

I do not want to have to move any file or change URLS.


Idea 1)

There is a WOrdPress plugin that I have used before which allow the Admin users to view 1 WOrdPress theme while serving a different Theme to all other users. THis allows you to keep the same URLs in place and allow access to the new theme/site while serving a different site to all other visitors.

I think this might be my best solution as I would simply create a simple placeholder page in the visitor WordPress theme.


I am curious of other simple solutions that could be done at a code level, any ideas?

  • Use a Plugin, it would be easiest solution. – Robert hue Jun 29 '15 at 21:46
1

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 />&nbsp;</p>';
    return $message;
}
add_filter('login_message', 'fpw_custom_login_message');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.