WordPress Content Visibility
The primary purpose of each site is to provide information to its visitors. Depending on the type of information published, in some cases it is necessary to restrict access on an individual basis.
WordPress provides а functionality that is called content visibility and which is controlling who can see site content.
By default, all posts and Pages are visible.
When you create Posts or Pages in WordPress you can set their visibility status to Public, Private or Password Protected. You can also make the entire website private through password protection or through the use of different plugins.
Setting Page and Post Visibility
You can manage the visibility for Posts and Pages from the Edit screen. The option is available within the Publish panel normally found at the top-right of the Edit screen:
The default visibility state for Posts and Pages is Public which means the content will be visible to the outside world as soon as it is published without any restrictions.
Click on the Edit link next to Visibility: Public in the Publish options to see all available visibility options:
- Public: The default, viewable to all.
- Password protected: Clicking this radio button followed by "OK" causes a further text box to appear, where in you can enter a password.
- Private: This option hides the content from the public completely.
Password Protected Content
Let's create a post with title Password Protected Post and visibility status: Password protected:
Password Protected content is not immediately visible to the outside world.
Instead, the title for your protected entry is shown, along with a password prompt. A visitor to your site must enter the password in the box in order to see the content:
If someone enters a wrong password there is no URL redirection or any warning message, the protected post just do not open.
WordPress also appends the word Protected: in front of the original post title.
Now let's change the visibility status of the same post to Private:
We updated the post, logged out WordPress and loaded the front page of our site where our new post should be found.
Our last post was not on the top of all other posts where it should be. And when we entered the correct post URL WordPress returned 404 error Nor Found.
This is the default WordPress behavior when a Post or a Page is created with Private visibility status - only authorized users can see private content. Anyone who can log in your WordPress admin can see the private content.
Normal users and visitors will not be aware of private content. It will not appear in the article lists. If a visitor were to guess the URL for your private post, they would still not be able to see your content.
Keep in mind though that private content is not protected in any way by users with the appropriate permission levels (Editor or Administrator). They can view the private posts in the Edit Posts/Pages screen, and they can modify them, or even make them public.
Hiding The Entire WordPress Blog
WordPress does not provide functionality that hides the entire blog from a public view or restricts access only to certain users.
There are different plugins that provide similar functionality.
In some cases you can use
.htaccess to restrict who can visit your web site.