How to Hide a Page in WordPress?

how to hide a page in wordpress

So you are looking for ways to hide your WordPress page. You’ve got a WordPress page that you want to keep under wraps – perhaps it’s a work in progress, sensitive information, or simply not meant for public consumption. We all know hiding pages from specific users, general public or search engines is a common requirement for managing and maintaining WordPress websites.

In this guide we’ll explore ways to hide your page with best practices.

Table of Contents

Why hide a page in WordPress?

Lets see why you might sometimes need to hide your WordPress pages or posts. 

Hiding page until its ready to be published

So, you’re in the final stages of crafting your masterpiece, but it’s not quite ready for publishing and public view. And, it takes time and multiple iterations to perfect your page. Hiding your page until it’s finalised is a necessity.

You don’t want Search Engines to find your old page

Another scenario can be this – you’ve got an old page which is outdated which still gets visitors and you’ve created a new page that better serves you and your users purpose. But the problem is that the old pages have some SEO value and you don’t want to lose it. In this case, you’ll need to hide the old page from search engines.

Your Conversion Confirmation Thank You Pages

The conversion confirmation thank you page – it’s a crucial component of your conversion funnel but do you really want everyone stumbling upon it? No way! 

Restricting access to Premium users only

Another major requirement to hide pages is that you’ve got premium content reserved for your loyal subscribers and you need to make the page accessible only to them.

Now that we’ve discussed the why’s of hiding WordPress pages, let’s dive into how’s.

Hide a WordPress Page for Users

How to Hide a Page Using Built-in WordPress Features

WordPress comes with special features, and one of them is the ability to hide your pages effortlessly. Whether you want to password protect or make the pages accessible to authorised users, you can do it without using any other plugins or tools. 

To do this, simply navigate to the page you want to hide, locate the “Visibility” option in the Publish box, and click on “Edit.”  Here, you can choose either “Password Protected” or “Private” to restrict access to authorised users only. Choose the one that best matches your needs.

Hide a WordPress page using Visibility feature

Password protection adds an extra layer of WordPress security to your hidden pages. After selecting “Password Protected” in the Visibility options, enter a password of your choice. Only users with the correct password will be able to view the page, ensuring that your content remains exclusive to those in the know.

Using Plugins to Hide A Page in WordPress

WordPress plugins can help you accomplish almost everything and there are plenty of options available to further customise your page hiding experience. 

Hide a page in WordPress using plugin

Plugins like “Restrict User Access” or “Page Restriction WordPress (WP)” offer additional features such as time-based restrictions or hiding pages based on user roles, giving you even more control over your content’s visibility. Some plugins even allow you to restrict access based on location and IP addresses. 

image 8

Hide A WordPress Page Using CSS

This is certainly an option but might not be the best one for non coders and it can affect your SEO. You can also hide your pages implementing CSS codes as necessary. To do this simply, find your page IDs or classes and set their display property to “none”. 

Sometimes simply removing links from navigation and other pages in the website can do the trick for you. And, even if you follow one of the above steps this might be a necessity to ensure there are no links in your website that lead to the page you want to hide. 

Hide a page in WordPress for Search Engines

Sometimes, hiding a page from users may not be enough and the pages may still appear in search engine results. Hiding pages from search engines might still be necessary to make your site SEO friendly and improve user experience.

Using Robots.txt To Hide A Page in WordPress

Robots.txt is a file on your website that controls which parts of your site search engine crawlers can access. 

Follow the steps below to hide a page using Robots.txt:

  • Access your site’s Robots.txt file via your hosting provider’s file manager or FTP client.
  • Add a line that disallows access to the specific page or directory you want to hide.
  • Save the changes to your Robots.txt file

Use the code below –

User-agent: *
Disallow: /page-to-hide/

Replace ‘page-to-hide’ with URL of the page you want to hide. For example, if you want to hide, use the code below-

User-agent: *
Disallow: /blog/my-blog-page/

Please note that sometimes, crawlers and bots are sometimes able to access the pages blocked by robots.txt and it may not be the ideal solution. Implementing this along with no-index tags is the suggested method. Read our blog – How to use Robots.txt in WordPress?

No-indexing pages

No-indexing tag tells search engines not to include a page in their index making it invisible in search engine results. You can do this using SEO tools like Yoast SEO or RankMath.

To no-index a page in WordPress (using RankMath):

  • Edit the page you want to hide in the WordPress dashboard.
  • Find the RankMath section (or your preferred SEO plugin).
  • Locate the option to set the page to “No-index” and save your changes.
No-index page to hide page from search engines

Redirecting Pages

Sometimes, it’s not enough to simply hide a page, you want to divert traffic away from it entirely. This will also preserve your SEO value. 

To redirect a page in WordPress:

  • Install and activate a redirection plugin like “Redirection” or “Simple 301 Redirects.” You can use RankMath redirects for this instead of using new plugin.
  • Set up a redirect rule that points the URL of the page you want to hide to a different destination, such as your homepage or another relevant page.
  • Save your changes.

See the below screenshot to create redirects using Redirection plugin.

Redirect page using redirection WordPress plugin

Best Practices for hiding pages & preserving SEO values

Redirect to relevant pages

When hiding a page, you should consider redirecting its URL to a relevant existing page on your site. This ensures that any traffic and SEO value for the hidden page is transferred to the relevant page while also maintaining user experience. 

Properly implementing no-index and confirming in Google Search Console

No-index tag is a powerful tool for hiding pages from search engine results while preserving their SEO value. However, it’s crucial to implement it correctly and confirm its effectiveness in Google Search Console. Inspect your URL in Google Search Console to confirm this.

Creating Custom 404 Pages

Even after implementing some of the above methods to hide your page, users may stumble upon these hidden pages. For this, you will need to craft a custom 404 page that not only guides users back on track but also maintains engagement and encourages exploration of your site. 

Some of the basics of the custom 404 page include links to popular pages, a search bar, and clear navigation options to keep users engaged even when they encounter a dead end.

As you update your website with implementing redirects and hiding pages, there are chances that your website can still contain links to broken pages, redirects and hidden pages. Consider removing unnecessary redirects, updating links, navigation menus and URLs as necessary to ensure seamless user experience and SEO friendliness. 

I hope this helped you to hide your WordPress page. Feel free to drop in comments and any concerns you might have. 

Still confused and need help managing your WordPress website? Book a free consultation to chat with our WordPress experts.

Updated on: 29 April 2024 |

Sazjan Neupane

Sazjan Neupane

Sazjan helps us reach our dream clients with his expertise in Search Engine Optimisation, PPC, Project Management & Online Business Development. He has worked with a variety of clients in different industries over the last 5 years. In his free time, Sazjan enjoys traveling and exploring new cultures.