Want to know how to hide a page in WordPress?
Hiding a page on your website may seem counterintuitive. But it can sometimes come in handy. For example, there may be necessary pages on your site, but you don’t want them to appear on search engine results pages (SERPs). Or you may want to protect your privacy and keep unwanted users from accessing specific pages.
We’ll discuss the reasons in greater detail shortly. However, the short of it is that at one point or another, you may need to know how to hide certain pages on your WordPress website.
In this article, we’ll discuss three simple methods you can use to hide a page in WordPress.
Why Would You Want to Hide a Page on Your Website?
In a nutshell, there are three main reasons you may want to hide a page on your website:
Relevance, or Rather, Lack of It
Some pages are irrelevant to your visitors, and landing on them will detract from your website’s overall user experience (UX). A good example is a page you publish to help with website verification. It’s good practice to hide such pages.
Not Every Page is Beneficial
Some pages on your website may be necessary for you but not beneficial to users or your overall SEO strategy. Hiding these pages will do you more good than making them public.
Another reason you may want to hide a page in WordPress is privacy protection. You may have pages with important customer or member information that you certainly don’t want to be made public. To enhance your privacy and keep sensitive data safe, you can hide these pages.
How to Hide a Page in WordPress — 3 Easy Methods
Now that you know why hiding pages on your site can be beneficial, let’s quickly dive into how you can do it.
Use AIOSEO to Hide a WordPress Page from Search Engines
The easiest way to hide a page in WordPress is by using AIOSEO. Because of the ease of this method, it’s the method we recommend the most — both for novice and seasoned website owners and managers.
To get started with this method, you, first of all, have to download the AIOSEO plugin. It’s one of the best WordPress SEO plugins around and has been downloaded over 3 million times — a testament to its effectiveness. Check out our detailed guide on how to install the AIOSEO plugin. The best thing about AIOSEO is that the free version comes packed with a tone of cool features, including hiding pages in WordPress.
Once you’ve installed AIOSEO, head over to the page you want to hide and edit it. Next, scroll down the page to the AIOSEO Settings and click on the ‘Advanced’ tab. Here, you will see a ‘Robots Setting’ option and a toggle that allows you to switch between default and custom settings. The toggle will be set to ‘Use Default Settings,’ so you’ll need to switch the toggle to the off position.
When you switch off the default robots settings, you’ll be presented with more robots meta options. To exclude your page from showing up in search research results, check the box that says ‘No Index.’
Save your changes, and AIOSEO will insert a line of code that prevents search engines from crawling and indexing your page.
Besides excluding specific pages from appearing on SERPs, AIOSEO also lets you hide certain sections of content. Again, this is easy as all you have to do is to go to your AIOSEO settings and click on ‘Search Appearance.’
On the Search Appearance page, you will find different tabs for different content sections, including Content Types, Taxonomies, Image SEO, and Archives. Click on any of these tabs, and you’ll see an option to ‘Show in Search Results. Set the toggle to ‘No.’
Selecting ‘No’ in this setting will no-index your page, preventing search engines from crawling it. The page won’t appear in search results and on your XML sitemap.
How to Hide Pages in WordPress Using Your Robots.txt File
The second way you can hide a page in WordPress is by editing your robots.txt file. This configuration file contains instructions that tell search engine bots how to crawl your site.
If you’re a beginner learning how to hide a page in WordPress, we don’t recommend you go through this route. That’s because incorrectly formatting your robots.txt file could hurt your SEO. That’s why we recommend you stick to the easier method of using AIOSEO to do the backend work for you.
However, if you’re interested in messing with a bit of code, you can hide a page on your website by coding instructions for search engines in your robots.txt file.
So how do you edit your robots.txt file?
Again, this is super easy with AIOSEO — and you can do it right from within your WordPress dashboard. To get started, head over to your AIOSEO setings and click on the ‘Tools’ option. This wil open up a page where you can access your robots.txt file and edit it.
Next, switch the ‘Enable Custom Robots.txt’ toggle to on. Doing this will enable you to add a new rule to your robots.txt file. To do so, simply fill in the form fields provided as shown in the screenshot below:
The user-agent field enables you to define the search engine bots allowed or disallowed to crawl and index your page. Putting an asterisk includes all search engines.
Allow/Disallow enable you to define the specific page you want to allow or disallow. In this case, we want to disallow so search engines don’t crawl the page. Ensure you only put the part of the URL that comes after your domain name in this field.
Let’s look at a hypothetical example of a page with a URL like this:
If you want to hide that page, here’s how you’ll add the URL to your robots.txt file:
Once done, save your changes and AIOSEO will automatically update your robots.txt file. Here’s what your robots.txt file will look like:
This method can be a bit daunting if you have no coding knowledge. However, with a bit of practice, it becomes easy as you don’t need to add any code. All you need to know is the URL of the page you want to hide. AIOSEO will do the coding for you in the background once you fill in the relevant fields in the robots.txt editor.
Besides the short learning curve, using this method to hide a page in WordPress also has some disadvantages. For one, your robots.txt file is publicly accessible, meaning anyone can access it directly and see the pages you’re hiding.
Another reason this method isn’t foolproof is that while most search engines follow the instructions in the robots.txt file, some other crawlers and bots may choose to ignore it. A typical example is crawlers and bots with the mandate of scraping websites to harvest important personal information. Other crawlers even go beyond that to spread malware. Again, these are designed to ignore the instructions in robots.txt files.
How to Hide a Page in WordPress by Password Protecting It
Another simple way of hiding a page or post in WordPress is by password protecting it. Doing this only makes it visible to users with the password. This is easy as WordPress comes with a built-in feature that allows you to password-protect posts and pages on your website.
To hide a page using this method, simply edit the page you want to hide. Then, in the WordPress editor, head over to the post settings and click on ‘Visibility.’
Clicking on Visibility will show you the visibility options available to you in WordPress. Here, you can make your page public, private, or password protected.
What’s the difference between private and password-protected pages and posts?
Private pages/posts are only visible to logged-in users with admin or editor roles on your website. On the other hand, password-protected pages/posts can only be seen by users who have the password.
To hide a page, select the ‘Password Protected’ option and enter a strong password to secure the page. Users will be asked to enter the password you’ve set to view the page.
One of the most significant advantages of this method is that it can help you monetize your website by only allowing subscribers to access certain content on your site. However, the better option would be to look for the best membership plugins to give you more flexibility in setting access controls.
How to Hide a Page in WordPress — Now You Know
There are many reasons for hiding certain pages in WordPress. These three will help you get the job done, no matter your reason. However, if you’re a beginner, we highly recommend the first and third methods as they’re easier.
Of course, to pull off the first strategy, you’ll need a powerful plugin like AIOSEO. So go ahead and download the best WordPress SEO tool now.