The moment you publish a post in WordPress, it becomes visible to anyone who visits your website. But did you know you can password protect a page or post in WordPress in order to hide content from the public?
Yes! You can restrict access to your pages/blog posts by introducing Passwords. Only visitors who have the correct password can view the protected content.
This feature comes handy when you need to publish premium educational resources. Now, if you want to password protect your entire WordPress site or individual WordPress posts – this article is for you.
In a short while, you’ll be learning:
- Reasons for password protecting WordPress sites
- How to password protect individual posts/WordPress pages
- Password protecting WordPress categories
- How to password protect a section of your page or post
- Password protecting an entire WordPress site
Reasons for Password Protecting WordPress sites
There are a number of reasons why you may choose to hide some pieces of content on your blog/site. For instance:
- If you want only friends, family or paid customers to see your site’s content
- When the site is yet to be completed or is in maintenance mode
- You are yet to obtain patent rights for the ideas shared on the site
- When the content is controversial or sensitive
- It is a membership site (though a membership plugin is better equipped for this purpose)
- When you are publishing a premium course or educational material
The scenarios listed above are tangible reasons why you may hide your site’s content. And as long as you do not broadcast your password, your content remains protected.
Some of the websites where password protection is frequently used include:
- E-commerce sites
- Online training sites
- Inventive websites
- Event sites
In the next section, you’ll learn how to password protect posts and pages by yourself.
How to Password Protect Individual post or WordPress page
This is the easiest of them all. WordPress has a built-in feature that lets you password protect a page or individual WordPress posts.
To password protect a page or post in WordPress, open the page/post in the WordPress editor. Go to ‘visibility’ at the right-hand side of your screen and click on ‘edit’.
The ‘visibility’ menu has three options; public, private and password protected. Setting a page’s visibility to ‘Public’ means anyone can view the page. ‘Private’ means only the admins can view the content of the page. ‘Password Protected’ means any visitor with the correct password can view the page.
Check the password protected radio button. You will be required to enter your chosen password. Your site’s visitors will be prompted to input this password when they attempt to view the content. Use a hard-to-guess password.
Voila! You have successfully password protected your post. This means anyone who attempts to read that post will need to enter a password first. If he/she enters a correct password, then the content becomes visible. Otherwise, the content remains hidden. Ensure you give the correct password to your chosen readers.
This exact method can be used in Woocommerce stores especially when you need to protect some Woocommerce products. The screenshot below shows how your post will look like at the front-end.
If you are protecting more than one page/post, you should use the same password for each one. Of course, it isn’t compulsory. But, you will save your visitors the stress of inputting different passwords. If you use one password for all protected pages, they will only be required to input it once and for all.
You might ask – can I use this method to protect WordPress categories and an entire WordPress website? The answer is NO. The methods are slightly different. In the following sections, you’ll learn how to password protect WordPress categories and an entire WordPress site.
Password protecting categories
WordPress categories are used to group or sort similar pages/posts. Now, sometimes you may need to password protect a WordPress category. In such cases, we’ll have to engage a third-party WordPress plugin.
This is because WordPress lacks an inbuilt capacity to password protect WordPress categories. Access category password is a free plugin you can use for this function. Install the plugin and activate it. Then, head to Settings >> Access Category Password.
Now, you should be in the plugin’s settings page. And it is very easy to configure.
Here is a brief explanation of each item on the plugin’s settings page.
- The password – Type in your preferred password in the space provided. And as we said earlier, use a hard-to-guess password.
- Impacted categories – at this point, select the categories you want to password protect. Posts belonging to protected categories will not be accessible to the public.
- Granting users – you can grant express access to certain user roles. For example, if you check the ‘editor’ box, anyone with an editor’s account won’t have to enter a password.
- Only single post – if you tick the ‘only single post’ box, visitors will see excerpts or contents of protected posts on other pages.
This WordPress plugin allows you to create the message displayed on your password protected page. Amazing!
How to Password Protect a section of your page/post
We have discussed how to password protect an entire page/post and category. But, what if you need to hide a part of the page instead of the whole page? In this case, you use a plugin – again. You can install Passster, a password protection plugin to do this.
As we always do, install and activate the plugin. Then, head to Settings → Passster and generate a shortcode with your password or create one manually. Save changes and copy the generated shortcode.
Then, click to edit the post you want to add password protected content to. Paste the shortcode wherever you want in your editor and type in your protected content.
Save and publish your post. Now, your visitors can read your post except the section you placed within the shortcode. See the screenshot below.
Password protecting an entire WordPress site
It is not difficult to hide an entire WordPress site from prying eyes of the public. All you need is a plugin to get it done. Password Protected plugin by Ben Huson is the most popular plugin used for this function. It has more than 200,000 installations with great reviews.
To get started, install and activate the plugin just like any other WordPress plugin. If you are not sure how to do that? Read our comprehensive guide on how to install a plugin.
After installation, go to Plugins >> Installed Plugins >> Password Protected Settings to set up the plugin.
There’s very little work left for you to do when the settings page opens before you.
Here’s a breakdown of what the settings page entails:
- Password Protected Status – when you check this box, your entire site is password protected. Otherwise, your site remains visible to anyone.
- Protected Permissions – you may check any or all of the boxes to allow Administrators, logged in users express access. You may also choose to allow RSS feeds, and Rest API access. Visitors who have your permission can access your website without a password.
- New Password – at this point, enter the password of your choice. Remember to make it difficult to guess.
- Allow IP Address – you may enter an IP address in the space provided. Anyone who visits your site from that IP address won’t need a password to gain access.
Finally, do not forget to Save Changes. Any visitor who doesn’t fall among those you have whitelisted will stumble on this page.
By default, this page looks similar to your WordPress login page.
Side note – anyone can access the images and files on your site, so far they have the direct link. This process only works for your main WordPress site.
Have you been wondering how to protect a page/post or entire categories on your WordPress site? I hope this article has helped you. You don’t need to be a technical expert to get this done. Either use WordPress’s inbuilt password protecting feature or use a plugin.
One quick tip – password protecting your website isn’t enough. You should also protect your website from malware and other security issues. Read our tutorial on how to secure your site.
So, have you tried password protecting your site’s pages and posts? Let us know how it worked out, and if you need any help in the comments below.