Want to keep your WordPress site away from prying eyes?! It’s really easy to password protect your whole WordPress site.
Simplest method – “Password Protected” plugin
You just need this plugin: https://wordpress.org/plugins/password-protected/
With a couple of clicks you can protect your whole site. The settings screen is below, it’s very simple to use:
You can allow admins to see the site if logged in, so that you can still work on your site while it’s blocked from the outside world, or you can allow access by IP address.
From the front end, a non-admin would see this:
Once the correct password is entered a cookies is set in the user’s browser that will keep them “logged in” until the cookie expires or they delete it.
Note that you may have issues using this with caching. But if your site is protected like this, it’s likely in development and therefore caching isn’t really necessary.
If you’re looking for something slightly more robust, you could try the htpasswd method. You can usually do this really easily from your hosting control panel. Here’s how you do it using the Siteground cPanel, but the process should look very similar on other hosts.
- Login and look for the Password Protect Directories icon.
- Select the site you want to protect, by choosing its main folder:
- On the next screen fill out all the details to set up a user name and password:
- You’re done! This is what it will look like when someone tries to access your site:
The method described here is for simple protection, usually used when a site is in development. If you need fully-featured user access to paid-for content, you’ll need a membership plugin. My preferred one is MemberPress:
These posts may float your boat:
Read the guide on Getting Started with MemberPress
Creating password-protected areas in WordPressSee this guide
Would you like to show custom content on your password protected page? See this guide