How to create and manage private pages in WordPress
Private pages in WordPress allows you to create pages that only certain type of users can access and it is not visible to the general public. It contains private content visible only to those with the right permissions. Depending on the settings of the private page, it may only be visible to some registered users, or it might be available to people who have the exact URL to the page.
The actual implementation of the WordPress private posts or the content restriction is a bit tricky. There are many different options in WordPress, and each one comes with its ideal use case, pros, and cons. In this tutorial, we look into different methods to use WordPress to restrict content to specific users. From simple WordPress password protected pages to WordPress membership sites.
What is a private page in WordPress
A private page in WordPress is a page that is only accessible to specific users and it is not visible to the general public. WordPress private posts are a great way to keep certain content on your WordPress site hidden from public view. By making a WordPress page or post private, you can control who has access to it, and ensure that only authorized users can view the content. This can be useful for a variety of reasons, such as if you want to create content that is only accessible to a certain user roles (e.g. subscribers), or if you want to create a private blog that only certain people can access. There are two primary ways to make a post private: by making it a password-protected post, or by restricting access to certain user role.
When private pages are needed
Now generally, when we create content in WordPress is to share something with our audience. The larger the audience the better, right? So why would we want to make a WordPress private page or private post and restrict access and limit the number of people that will be able to see it? There are several situations where Private pages/posts are quite useful. For example:
- Creating Draft pages of design and content – Private pages are ideal for situations like this where you want to share content with your colleagues and team members while still editing and tweaking the content and the design of the page.
- Closed forums and communities. Private pages are ideal for exclusive forums and online communities with private content that is password-protected or accessible only to different member groups and registered users.
- Sharing content with a specific customer. Often, we need to show a preview of some content to our customers. Maybe there’s a photo shoot that needs to be approved. Or even a content piece that you need to show them.
- Internal communication and content sharing. Private pages and posts can be used to share knowledge base type of content like guidelines, training material, and other content that is intended for internal company use and that visitors shouldn’t be able to access it.
- Private blogs. This is for people that use blogging for journaling. This is their private site and the content is intended for personal use and not necessary to be available to the wide public but still have the option to share it with friends and family members.
- Premium content. Private pages can also be for premium types of content where people are charged to access the content. This can be for different types of digital products such as eBooks, courses, songs, or downloadable files.
That’s just a handful of examples, but there are certainly more use cases. But let’s see now how to implement them on your WordPress website.
How to create private WordPress pages and private WordPress posts
First, the most basic example. If you want to create WordPress private pages for registered users or access with passwords, this can be done with no plugins. WordPress offers private pages and password-protected pages.
Creating password protect page in WordPress
The passwords can be used for simple content locks, and usually works if you have to analyze the access to this content on a case-by-case basis. Visitors of your website will be able to see the title of the page but they won’t be able to see the content of the page unless they have the correct password. Therefore, you create password protected pages, and only users (registered or not) who really must see these WordPress private pages are going to see them. This is a valuable method if you only have a few pages that you need to protect.
Creating a private page in WordPress
On the other hand, WordPress also has private pages. These pages are in essence hidden from regular users. While the password protected pages still show up on WordPress post lists, WordPress private pages don’t. Even if users have the link to the protected page they won’t be able to see it.
WordPress private pages can only be seen by editors and administrators. It’s possible to change this behavior and authorize other specific user roles, though. For instance, you could use a plugin for that.
But the truth is, once you create private pages, they won’t be seen by your visitors.
Creating WordPress private pages accessible to registered users only
Although very versatile in general, WordPress has very limited page restriction capabilities right out of the box and they are generally targeted towards admins and editors, and only logged-in users at the Admin level can see and manage them. What if we want to restrict content that is accessible to our registered users only? Not only that but also restrict content only to specific users and subscribers but not to others, based on different rules, user types, and access privileges. Luckily, WordPress has a large plugin ecosystem that provides several solutions for situations when we might need more advanced content access management. Let’s look into some different content restrictions scenarios and when they might be useful.
Restrict access to pages based on user roles
Although restricted pages can be used for content lock based on user roles, this is not a very practical solution. As they are intended for admin use only, often they are set to be hidden in your posts lists, and they can’t be used as teasers. Therefore, unless your users log in, they won’t know about the existence of these pages.
For that, you can use a different WordPress plugin such as the Ultimate Member. This plugin creates a membership section on your WordPress site. Hence, you automatically have the private content aspect, without the hassle of modifying the WordPress protected pages.
Once you install and activate it, this nice little box is shown below your content section:
Then, once you use it, this content is going to work like your WordPress private pages, but better. The Ultimate Member plugin allows different content level access, as well as teasers. Therefore, it’s a quick way to lock down content, create members-only pages, and still, get your users’ interest. It’s also possible to lock down entire categories. You can do that in the quick edit, or the category edit screen.
Restrict access to pages based on paid memberships
We can take it to the next level, by creating WordPress private pages in form of a membership site. With memberships, we can have different plans and access levels, and it’s even easier to control your content access.
For this purpose, we use the Paid Memberships Pro plugin. It’s a quick alternative to the Ultimate member plugin, and it is a free option for WordPress memberships.
First, we can create different membership levels. You can do this at WordPress Dashboard > Memberships > Membership Levels. Let’s add a Hobby (free), a Basic, and a Gold membership just so we can see how it works.
There are many options regarding your memberships, such as adding trial periods, different billing cycles, and setup fees. Just to make things easier we created 3 plans. Then you create the membership pages (or let PMP create them for you) and set up the billing details.
Once this is done you are ready to use your Membership site and restrict content access.
Similar to the Ultimate Member options, now when you create posts and pages you can see the membership field:
The main difference here is that you can allow different access levels depending on your user’s membership plan.
Managing users based on content visibility
The Users Insights plugin can be used to track down users and their behaviors. Therefore, in addition to creating your WordPress private pages and membership section you understand your user base. It’s possible to filter users based on membership status, login activity, and the number of visits. In addition, it’s possible to combine different filters from different plugins to gather a broader view of your audience.
See who can access certain private pages
Often, we might need to see what users can access what pages. If we know what type of members or users roles have access to a certain page, we can use this to create Users Insights filters that will show us exactly the users that have access to that specific page. We touched on some of these aspects in our guide on How to create and manage a membership website with WordPress.
For instance, you can filter all users based on their membership level.
The same rule applies to negation filters. Therefore, if you have a sale in your premium plans, for example, you could filter all users who don’t have them.
Then we can combine the user filters with location data. To better understand our audience, we could check how many active users we have in the US, for instance.
Speaking of the membership status, we could use a similar filter and try to recover our inactive users. This is useful if you know the main reasons for canceling, and if you have fixed them.
As long as we have other plugins, we get a much better understanding of our audience. For instance, you can find out which niches or occupations your memberships are good for. This is incredibly useful for targeted marketing campaigns. You can export these user lists to get in touch with them via MailChimp, for instance.
See who has accessed a specific private page
There is also a method where you can see who has accessed what page on your website. To see who has accessed a specific private page, go to the page in question and click on the “Has visited” page filter, and select the page that you want to check. This will give you a list of users where you can see all the users who have accessed that page. Here is a short video showing you how to track WooCommerce user activity and how to check which users have accessed a specific page:
In the same way, you can track all other private pages on your website.
Conclusion
Today we saw many paths you can go to create WordPress private pages and how to password protect WordPress. We went through the details of each approach, its pros, and cons. Additionally, we checked how you can use other plugins, such as Users Insights, for better membership site management.
We hope you enjoyed it and see you again next time!