Set All Your WordPress Posts and Pages to Private

A PublishPress user asked us an interesting question: they wanted to know if it was possible to make their entire site private.

WordPress has a feature called “private pages” and “private posts”. This content is published, but it is not publicly visible. This guide has more details on private content in WordPress.

I'm going to show you how to configure your whole site so that all the content is marked as “private”. This will happen automatically and will be locked, so there's no chance that the public will be able to see your content.

Setting all posts and pages to Private #

First, install these two plugins:

Now we're going to configure the Permissions plugin:

  • Go to Permissions > Settings in your WordPress admin menu.
  • Click the “Editing” tab.
  • Change the default visibility for new content to “Private”.
  • You can also check the “Lock” box which means that users will not be able to change the visibility.

Now you can test out this visibility setting:

  • Create a new post.
  • There will be a “Visibility” box in the right sidebar. This is part of the Permissions plugin.
  • Click “Publish” when your post is ready.
  • After you have published your post, come back to the editing screen.
  • The “Visiblity” box will be set to “Private” and there will be this message: “Visibility is locked by default settings.”
  • When you go to the main “Posts” screen, your new post will be marked as “Private.”

By default, all new content will be private. You can also edit any existing content and change its status also.

  • On the main “Posts” or “Pages” screen, select the content you want to update.
  • Under “Bulk Actions”, click “Edit”.
  • In the “Status” box, choose “Private”.
  • Click “Update”.

Control access to Private content #

By default, only Administrators and Editors can see “private” posts. However, with the PublishPress Capabilities plugin, you can give access to other groups too.

  • Go to “Capabilities” in your WordPress admin menu.
  • Select the role in the top left corner.
  • In the center of the screen, in the “Reading” area, you can give this role access to your Private content:

What will site visitors see? #

If someone comes to your site, they will see no content at all. They may see some widgets or other items, but all content will be hidden.

Even if the visitor knows the URL of a Post or Page, all they will see is a “Page Not Found” message.

You can take a few approaches to redesigning this message.

You can use the Teaser feature in PublishPress Permissions, or redirect visitors to a URL.

Or you can redesign this landing page. For example, you can place a login box on link on your homepage.

  • Go to Permissions > Settings in your WordPress admin menu.
  • Click the “Editing” tab.
  • Uncheck the “Lock” box quickly.
  • Create a single Page called “Welcome to My Private Site”. I've added a simple link to the login form, but you could add a login form using a plugin like PublishPress Blocks.
  • Make sure this page is public.
  • Go to Settings > Reading in your WordPress admin menu.
  • Set your homepage to your new Page.