Password Protect Your Entire Wordpress Website

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.

custom-wordpress-login

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

wordpress-function-password-protect

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:
  • WordPress Under Attack
  • How to add Adsense ads Between wordpress Post
  • Making Your Personal Website
  • Gmail Sending Email from an External Address
  • Wordpress Show Parent Title if Showing Children Pages
  • Wordpress Alphabetizing Posts
  • Should I Change My Website Into a Blog?
  • If you have any questions, addtional information, or found this helpful "Leave a Comment" below.
    blog comments powered by Disqus