If you want to hide a page in WordPress, here are the techniques you can use. You can also use these same methods to hide WordPress blog posts as detailed below.
Each method is fairly simple in itself but you have to first understand who or what you are trying to the page from in order to figure out the best solution: the public, search engine bots, or most of your site visitors (by removing it from your WordPress navigation)
- Method #1. Hide A Page by Setting the Visibility to “Private”
- Method #2. How To Hide a Page In WordPress with a Password
- How To Hide A Page In WordPress Can Mean Other Things
- Many Different Ways To Solving How To Hide A Page In WordPress
Method #1. Hide A Page by Setting the Visibility to “Private”
The easiest way to hide a page in WordPress is by setting the visibility to “Private”. To do this, open the page in the WordPress editor, open the page settings, and under the “Visibility” option, choose “Private” as shown here:
Accept the confirmation that appears, and you’re done! Your page is now private. Here’s what happens when you mark a post or page as private:
Private Pages Can’t Be Viewed by the Public
After you mark a post or a page as private, anyone who’s not an administrator or editor won’t be able to access it by navigating to the URL. If they try, they’ll get a “Page Not Found” error as shown here:
If you try and visit the same URL while logged into WordPress as an admin, the page will appear as normal, which can be deceiving at first.
This makes marking a page as “Private”, the fastest way to hide a page in WordPress.
Lastly, it is worth noting that your WordPress page is also going to be removed by Google if it is private for long enough. Google thinks that the page has in fact disappeared and it doesn’t know that you plan on reenabling your WordPress page. It won’t be an instant removal or anything but most search engines follow links and crawl your site every few days or weeks so it’s important to get the page back up within a few days if that page has valuable content.
Why Not Mark it as a Draft Instead Of Hiding The Page?
You might think that not publishing a post at all is easier than marking it as “Private”. And you would be right in many situations! Based on your needs, simply not publishing a page or a post and leaving it as a draft might be a simpler solution than first publishing it and then marking it as private.
I myself unpublish posts and pages regularly when I want to hide them away from public view. But marking a post as private after publishing it has some advantages.
Advantage #1: you can collaborate on private posts with a wider range of people than you can with a draft. Specifically, it’s hard to share drafts with other people since there’s no standard URL that you can use. If you’re going to collaborate with a lot of people on a piece of content, it’s easier to mark it as private rather than keeping it as a draft.
Advantage #2: publishing a post instantiates WordPress’s version control mechanism. A draft, on the other hand, doesn’t have version control, which means that you can’t easily revert to a previous version and undo changes. For collaboration purposes, version control is a must.
Advantage #3: a draft might not display in the same manner as a published post, for a variety of reasons. If you want to fully look at how a post will appear in its finished form, then there’s no substitute for publishing it with all the plugins active.
For these reasons, it might be better to mark a post as private, rather than keeping it as a draft.
Method #2. How To Hide a Page In WordPress with a Password
Similar to setting it to “private”, you can also hide a page or post in WordPress by protecting it with a password. The password protected method is almost the same as the previous technique, where you open the page settings and choose “Password protected” instead of “private” as shown here:
After setting a password and saving your changes, if someone tries to access your site, this is what they’ll see:
Anyone who wants to access the page will need the password. It’s a great way to share a private post or page with a person who doesn’t have an account on WordPress. Just share the password with them privately, and they can access the page.
Password protected sites do single to a user that something is under construction or there is some sensitive information typically.
But Search Engines Will Still See The Password Protected Page
The big problem with hiding a page in WordPress using the password feature is that search engines will still see the protected page and it will be included in search results. They won’t be able to see the full content, but they’ll notice that it’s protected with a password. This isn’t ideal, since you want search engines to index the post for the first time with the full content. You don’t want them to think that it’s a private post, since they may take a while to refresh their opinion of the page.
For example, let’s say you have v1 of your homepage done and you don’t want anyone to see it except for your business partner so you enable password protect on the page. If it takes a few days before you remove the password protected option, Google may crawl your site and think the partial content on the page (mostly information in regards to the password protected status), then it may think that’s it and you won’t be reaching your full potential. Man, these search engine bots are annoying, huh?
One workaround is to use a throwaway URL for the password-protected page, and then when you finally publish it, change the URL to what you want it to be. It’s a bit of a fiddle, and there’s always the risk of you forgetting to change back the URL, but it’s certainly an option.
How To Hide A Page In WordPress Can Mean Other Things
Hiding a page or blog post in WordPress can be complicated, depending on who you actually want to hide the WordPress site, post or page from. For example:
- Do you not want the page to be visible to the public?
- Do you want to hide it from the search engines?
- Do you want users to be unable to find it via navigation?
I’ll show you how to go about this for each of the above use-case scenarios.
To hide an already published WordPress page from the public, simply use one of the methods listed above. Either set it to a “draft”, or make it private, or you can even protect it with a password if you don’t care about search engines seeing the restricted page.
How to Hide a Page from Search Engines (No Index)
The easiest way to hide a WordPress page or blog post that’s already published from search engines is the install the Yoast WordPress plugin. The good news is that almost every WordPress website already has this plugin, and if yours doesn’t, then it should!
After installing Yoast, open the page in WordPress or WordPress posts that you want to hide in the editor, and scroll down and beyond the bottom of the post. Here you’ll see the Yoast options for the page. They may be hidden, in which case, click the downward arrow next to it and expand the section. Scroll further down till you see a box called “Advanced”. Expand that and you’ll see this:
Under advanced, you’ll see a section called:
“Allow search engines to show this Post in search results?”
In the drop-down box, select “No”, save your changes, and you’re done! Yoast will set the meta robots tag for this page no “noindex”, and you’re done!
Note: “noindex” means that search engines will still see your site – they’ll just choose to not index it and show it in the search results. If you want to block search engines from even accessing the page, then you should use “disallow” in the robots.txt file. However, this is considerably harder.
Removing a Page from the Navigation (Sunsetting)
If you just want to remove a page from the navigation menu, appearance “Appearance” on the left-hand side of the WordPress dashboard, and click Menus. Here, you’ll see a list of all items on the navigation. Find the page that you want, expand it using the downward arrow, and click “Remove” as shown here:
Save your changes, clear your caches and you’re done. Your page is now hidden from navigation. Of course, if another page links to it within the content, someone could still end up on it. Sometimes it makes sense to hide a page from your WordPress site by removing it from your navigation if you just don’t want as many people finding that page anymore but it still may be somewhat important. For example, let’s say that was an old product page or service and you no longer want to sell the product anymore because it has low margins. There are still sales coming in, and people are finding it on Google, but you don’t want even more people finding it. Removing it from the navigation of your WordPress site could be the right solution.
Many Different Ways To Solving How To Hide A Page In WordPress
As you can see, there are many different ways to figure out how to hide a page in WordPress. It all depends on whom you are trying to hide it from. Hiding a page from search engines is different from hiding it from viewers, which in turn is different from hiding it from other authors. Depending on what exactly you want, choose the method that works best!
I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!