Sometimes you will want to hide certain content from your website visitors or discourage search engines from crawling it. This is quite a common practice, so sites like Google are happy with you letting them know what not to index. If you’re wondering how to hide a page in WordPress, don’t worry. There are several ways to do this, and some are really straightforward.
In this article, we will cover multiple methods you can use to hide any page in WordPress and explain each of them step by step.
Why would you want to hide pages? 🤔
You might be looking into hiding a WordPress page from your visitors or search engine bots for many reasons. For instance:
- Some of your pages are under development and not ready to be shared. For example, you are preparing a product or service launch.
- You want specific users to see the content. For example, people undergoing training or specific stakeholders.
- You have pages that contain private or sensitive information, and you don’t want it falling into the wrong hands. For example, user profiles.
- You used a page for verification purposes, but it has no use for visitors. For example, a page you upload to verify ownership for an SSL certificate.
No matter the reason, if you want to hide a page from visitors or exclude pages from search results, there are, in fact, many ways in which you can do this.
How to hide a page in WordPress? 🙈 What are the methods?
In the following paragraphs, we’ll cover effective methods you can use for hiding pages on your WordPress site, including:
Method 1: Changing the visibility setting of a page in WordPress
Let’s start with the easiest method for hiding WordPress posts or pages – changing their visibility.
The posts and pages on your WordPress website can support various visibility settings, including options to make them private or keep them accessible but protected by a password. Let’s start with the first option, making your pages private.
First, go to your page and click on Edit. If it has been published (if it’s not a draft), on the right-hand side, you’ll see an option that says Visibility. The default should be Public. If you change this to Private, only you will be able to see it.
You can read more about WordPress private posts in this article. One thing to keep in mind when using the Private visibility option is that any images you use within it will remain public. A visitor would still need a link to see them, but the pictures themselves will continue to live in your media folder – which is not private!
Method 2: How to hide a page in WordPress from the navigation menu only
If you want to hide a page so your visitors don’t come across it, but you still want it to be online, one possibility is to simply remove it from the navigation menu. Many websites do this with their blog posts, mainly when they are intended primarily for SEO purposes (for example, to drive people to the products or services on a site but not necessarily as cornerstone content).
To do this, go to your menu (Appearance → Menus) and remove the entry for the page by clicking on the little down arrow on triangle (which will expand the item) and then on Delete. Don’t forget to press Save when you’re done, or the changes won’t be applied!
Method 3: How to hide a page in WordPress by setting a password for it
This method for how to hide a page in WordPress is similar to the first one we covered, with the only difference that, instead of choosing Private as your new page visibility, you would select the Password Protected option. Then, all you need to do is write your preferred password and click on Update to save the changes.
Method 4: How to hide a page from search engines using a plugin
There are several WordPress plugins that include an option to hide specific pages from most search engines or visitors. A popular one is Yoast SEO, which allows you to set any post or page to
💡 Before we go into the step-by-step instructions on how to do this, let’s review what
noindex means and why it matters.
Noindex is an HTML meta tag that tells engines not to include specific pages or posts in their search results. Many website owners use
noindex to hide pages with duplicated content, thin content, or not built for SEO performance.
You can easily access and change this setting by using a WordPress plugin like Yoast SEO.
The first thing to do is install the Yoast SEO plugin on your site. You can do this by going to Plugins, clicking on New, and then searching for it by name. Remember to also activate the plugin!
Once you’ve installed the plugin, you’ll notice your pages now have a new box when you edit them. Scroll down to it and open the tab called Advanced.
There are two important settings here, but the one you will want to check is the first:
Allow search engines to show this Page in search results.
There are two options in the dropdown:
Yes (which is the default for all pages) and No.
To disallow search engines from indexing your page, simply choose No. Don’t forget to click on the Update button to save the changes.
Method 5: How to hide a page in WordPress using the robots.txt file
⚠️ This method is not recommended by Google. Implement at your own risk.
Last but not least, if you want to hide a page in WordPress then you can give this method a shot. Although it’s not a difficult task, we’ve left it as the last method because there are always risks associated with editing your sites, particularly when it can affect SEO. So, only do this if you feel comfortable making changes.
Open the file and add the following lines:
User-agent: * Disallow: /your-page/
The asterisk in the first line means that you will be targeting all search engine bots. The next line is your page’s address, so make sure to change it to the one you want to hide.
For example, if you want to hide the page
http://example.com/2023/03/my-page/, you would write:
User-agent: * Disallow: /2023/03/my-page/
Once you’re done, don’t forget to Save your changes. If you were working locally, you should also upload your file back to the server.
Now, one last important consideration:
Most search engines (though not all, as Google will tell you) will follow the robots.txt instructions and not index a WordPress page that is defined this way. However, your robots.txt file is public, so other agents will be able to see which pages or blog posts you’re choosing to hide.
Final thoughts on how to hide a page in WordPress 💭
In conclusion, hiding pages in WordPress can serve various purposes, such as keeping content under development private, providing exclusive access to specific users, safeguarding sensitive information, or excluding pages from search results.
In this tutorial, we covered five different methods to achieve these objectives effectively. To recap:
- Changing visibility settings: You can make a page private, allowing only authorized individuals, like yourself, to access it. Keep in mind that images within the page may still be visible, but only those with a direct link can view them.
- Removing from navigation menu: If you want to ensure that visitors don’t come across a specific page, simply remove it from your website’s navigation menu. This keeps it online but out of sight.
- Setting a password: Adding password protection to a page grants access only to those who have the correct password. This is ideal for providing exclusive content to specific users or stakeholders.
- Using Yoast SEO: By setting pages you wish to hide to
noindex, they won’t appear in search results.
- Editing the robots.txt file: Although not recommended, and it does require some caution, editing the robots.txt file allows you to instruct search engine bots not to index a particular page. This method grants you control over what search engines display.
Now that you have a solid understanding of how to hide a page in WordPress, we encourage you to explore these techniques further and use the one that best suits your needs.
Have you ever heard of or tried using any of these methods before? How did it go? Do you know of any other ways to hide a page in WordPress? Let us know in the comments below!
4 Essential Steps to Speed Up
Your WordPress Website
Follow the simple steps in our 4-part mini series
and reduce your loading times by 50-80%. 🚀