Private Page/Post, How To in WordPress

The aim here is to make a WordPress post or page private. (Not the whole site. To make the whole site private, see link below.)  That means no one can see it, even if they know the URL.

Actually I want to make all the pages/posts within a category to be private.  So let’s go …

The only person who can see the private post/page will be you (and anyone with admin or blog editor permission). And only when you are logged in.

Note: to make the whole WP site private, please see How to Make WordPress Site Private.

When you are logged in (to WordPress), you will see your private pages/posts in both your admin dashboard area and when viewing your site as a user.

For simplicity, I will write this article as if there is only a single (admin) user.


The Scenario:

  1. I want to be able to write multiple WordPress posts/pages and make them invisible to everyone but myself. And I can only see them if I am logged into my WP (admin) site.
  2. Even if others knew the URLs, all they would see would be  404 Error Page Not Found messages.
  3. I want to be able to put all my private pages/posts under one category. This will make it easier for me to find my private posts when I am viewing my site as a (logged in) user.

 

Solution:

This is a workaround solution.  WP is unable to make a category private – which would be so much easier.  So we have to work around that.

Create new category

Make New Category

Make a new category.  I would suggest that this category contains only private posts/pages.

WP admin >> Posts >> Categories

In this example, I will create “Private Category” as the new category.  (You can name yours whatever you like).

 

 

Make Private Post/Page

make a post private

Note: for simplicity, from here onwards, I will write “post” to denote either post or page.

Create a new post. You should then be in the edit post mode.

On the right hand side, under “Publish”, you will see that by default, your post has Visibility = Public

Click on the “Edit” link >> select Private >> OK
When Visibility = Private, post is private.

By doing just this, when you publish, only you (when logged into WP) will be able to see the post.

FYI: You can change the visibility of a post at any time by editing.

The next question is, if you have a number of private posts, how will you find them when you are viewing your site (rather than being in the admin area)?

For that, we will use the new category we created before: “Private Category”

On the right hand panel of the post you are creating, under

Categories >> select “Private Category”

 

To View your Private Posts

Now that you have your private posts with:

  1. Visibility = Private
  2. Category = “Private Category”

how do you view this category?

There are a number of ways of doing this, but I shall show only show the one I am using at this time.

FYI: I am using Genesis child theme within a Genesis framework.

Create New Menu

When you have published your private page(s) under “Private Category”, create a custom menu to contain only this category.

For this example, I have created a menu called: “Private Menu”.

And then put the category “Private Category” into this menu.

Admin >> Appearance >> Menus and create a new menu.

create new menu

(I am working on assumption you know how to create a WP menu.)

 

Use Widgets to Postion Menu

Next, I will place my “Private Menu” at the bottom of my sidebar. I will do this using the “Custom Menu” widget.

Admin >> Appearance >> Widgets >> drag Custom Menu widget to Primary Sidebar widget.

Addendum (27 Apr 2019):  The “Custom Menu” is now called “Navigation Menu”

Drag widget into sidebar

Please note that I will put it below “Recent Posts”.  You can put it anywhere of course.

Once the widget is in place, you can configure it.

 

Note: The Title is optional.  If you enter text there, that will appear on your page.  I have left mine blank.

Addendum: 27 Apr 2019When you view your site, you will still see the name of the “Private Menu” (or whatever you named it in Admin >> Appearance >> Menus when you created your new menu).  To prevent this, you can specify the visibility of the Navigation menu widget (formerly named Custom Menu).  Click the ‘Visibility’ button.
Tip: Click the “Visibility” button to specify the conditions when this will only show.  For example, I specified:  Show if User is Logged In (because there is only one person who logs in at my site, and that is me!) So I myself will only see it when I am logged in.

 

Now when you view your site, the “Private Category” (which is in the “Private Menu”) will be shown in the sidebar.  For my example, it is under “Recent Posts” as alluded to above.

Anyone other your (logged-in) self, who clicks on that link will only see a “Page Not Found” error message.


 

 

Enjoyed this post?

Easily subscribe to keep get all new postings via email. No We Don't Serve Spam - Ever!

We respect your privacy

Your Comments? Tips to share?