Password Protect Your Entire Wordpress Website
You can password protect a wordpress website during development so only a client can see it.
Or for your own reason.
Just follow the 5 steps.
1. In the admin panel. Create a new account. That’s the one the visitor will use.
2. Go Under the Settings tab and uncheck “Anyone can register.
3. You can go under Appearance Tab – Theme Functions (functions.php) and add the code below somewhere (if it is at the top of the page, it should be after the <?php and not in between a /* and */) ***Replace the fancy quotes with the right ones
Code
function password_protected() {
if ( !is_user_logged_in() ) {
auth_redirect();
}
}add_action(’template_redirect’, ‘password_protected’);
add_action(’do_feed’, ‘password_protected’);
It should look like this
4. Go Under the Settings tab -> Discussion, uncheck “Attempt to notify any blogs linked to from the article (slows down posting.)” and “Allow link notifications from other blogs (pingbacks and trackbacks.)”
5. In Settings -> Privacy, select “I would like to block search engines, but allow normal visitors” for Blog Visibility.
That’s it your done. now only people with the password can see the website
People who read this also read:



