This article will show you how to hide a page in WordPress. There are many different reasons why we might want to prevent a page from being seen on our website. But it is not always as simple as just hiding or showing a page.
We will start by identifying 3 different scenarios where we would want to hide a page. The article will then show how to hide a page in WordPress for each scenario.
Why would anyone want to hide a page
Most commonly, we may need to hide a page temporarily because the content has become outdated and needs to be updated before we re-publish the page.
Other times we may want to hide a page from the search engines. Maybe we want to hide our pages with terms, conditions and cookie information from the search engines. Or maybe we simply want to hide certain pages that link to free resources that we only make available to mailing list members.
Finally, there is the scenario where we want some but not all people to have access to a particular page. Maybe we want to restrict access to a VIP group of our mailing list. Or maybe we simply want to make sure that only website administrators and editors working on the page have access.
I would also like to point out that we follow pretty much the exact same steps whether we are creating a new page or updating visibility status for an existing page.
And there are of course many different ways to achieve the result we are looking for. But, as always, I will show you the easiest and less intrusive way to achieve the objective.
Hide a page temporarily
When we need to hide a page in WordPress on a temporary basis I recommend working with the WordPress “Save draft” function.
With “Save draft” we create a working copy of our document without actually publishing the page.
This works just as well with an existing page as it does with a new page.
Create new page and hiding temporarily
When we create a new page we start at the WordPress Dashboard and select Pages > Add New.
When we have written and optimized our page we simply select “Save draft” to save our working copy of our document without publishing the page.
Hiding existing page temporarily
If we have an existing page that we need to hide temporarily to for example update the content we simply open the page in Edit mode.
Go to the WordPress Dashboard and select Pages > All Pages. Now hover over the page name to display and select the Edit option
With the page open in Edit mode we now have the option to re-save the page as a draft. Simply choose the “Switch to draft” option to create a working copy of your page that was previously published. Your page is now not visible any longer.
When you are done updating your page you will have to publish it again for the page to be visible on the Internet.
Hiding a page from search engines
As you probably know by now I am no fan of using plugins for everything.
However, there are a few exceptions. And using the free version of Yoast SEO is one plugin that I find useful.
And one of the reasons is that this plugin helps us with several problems.
One of these problems happens to be how we prevent search engines from indexing any one particular page of our choice.
If not already done you have to install the plugin Yoast SEO.
Now, on each page when you enter the Edit or Create mode you will see a section called Yoast SEO at the end of your page.
Click on the tab that reads “Advanced”
Now select the value “No” for “Allow search engines to show this Page in the search results”.
Also select “No” for “Should search engines follow links on this page”.
When done you simply update, save or publish your page for the settings to take effect.
Now, these changes will only affect the page you updated. You can check by right-clicking and selecting “View Source” when you view the page in your web browser.
If you look towards the top of the page you should find a line similar to the one below:
<meta name='robots' content='noindex, nofollow' />
And to be absolutely sure, visit another page on your website. Do the same Right Click > View Source exercise. You will only find the no-index code on the pages you have specified.
How to hide a page for some visitors only
To hide a page for some users is usually more about who should be allowed to view the page.
And there are of course different scenarios but there are 2 useful tools that can be used depending on what you are trying to achieve.
For both new and existing pages we have the option to change the Visibility to Private when we are in the Edit mode.
After selecting Private we are prompted with a pop-up asking us if we are sure that we want to publish the post privately.
After all, this could affect search engine rankings as the page only will be visible to website admins and editors. This is a useful option when we are working on a page not yet quite ready for the general public.
If we on the other hand want to grant access to a select group of visitors we can always use the “Password Protected” option.
When selected we will be asked to enter a password in the “Use a secure password” input box. This password will be needed to access the page.
Needless to say you would also need a secure way to distribute and manage the password to your desired group of people.
As you have seen there are several easy ways to hide a page in WordPress.
However, as we work hard to get our pages indexed and ranked in the search engines, I would like to suggest that you proceed with caution when hiding pages.
Do make sure that you know what you are doing.
And if you are working on a page with good rankings, please be aware that there is no guarantee that your amended page will return to its previous rankings when published again.