Saturday, June 15, 2024

How to Hide a Page in WordPress? [2 Easy Methods]

- Advertisement -
- Advertisement -


WordPress is a content management system (CMS) that permits its user to host and make websites. WordPress includes plugin architecture and a template system, so you can change any website to suit your business, blog, portfolio, or online store.





  1. How to Hide a Page in WordPress?  

The first method is a very simple way of hiding a page or post in WordPress employing password protection.

Accomplishing this only causes it visual to users with the password. This is straightforward as WordPress arrives with a built-in feature that permits you to password-protect posts and pages on your website.

To hide a page utilizing this method, just revise the page you want to hide. Then, in the WordPress editor, go over to the post settings and click on ‘Visibility.’


Password Protected


Touching on Visibility will display the visibility prospects open to you in WordPress. You can create your page public, private, or password-protected here.

What’s the difference between private and password-protected pages and posts?

Private pages/posts are only observable to logged-in users with admin or anyone with editor roles on your website. On the other hand, password-protected pages/posts can only be witnessed by users who know the password.

To hide a page, choose the ‘Password Protected’ option and provide a strong password to ensure the page. Users will be requested to give the password you’ve set to see the particular page.

One of the most important benefits of this method is that it can assist you to monetize your website by only permitting subscribers to access specific content on your site. However, the more useful choice would be to examine for the best membership plugins to offer you more flexibility in setting access management.





  2. How to Hide a Page in WordPress Using Your Robots.txt File?  

The second method that can help you to hide a page in WordPress is by editing your robots.txt file.

Robots.txt is a file discovered in the root directory of your site that signifies Google and other search engine bots for which posts and pages to crawl.

To edit it, log into your hosting account’s cPanel and choose the File Manager icon under the Files section as shown in the figure below.


File Manger


In the navigation menu on the left-hand side of your display, choose the public_html folder. Discover the robots.txt file and touch Edit from the menu at the top of your screen.



It will open in a text editor like Notepad on Windows or TextEdit on a Mac. Remove any existing text and copy and paste the following code:

You’ll require to substitute the placeholder text in the Disallow field with the URL path of the page you like to hide from the search engines. The path is everything after your domain name.

For instance, the URL of the page you wish to hide is:


You can leave the User-agent field as is since the asterisk represents any web crawler that will be recommended not to index this page.

If you’d wish to hide this page from Google only, then substitute the asterisk with “Googlebot” in the user-agent field then it will hide a particular page from Google.

Doing so will permit other search engine bots to index the page.

Once you’ve completed your modifications to the code snippet, save and upload the robots.txt file back to your public_html folder.


Upload a file


Google search crawlers will directly observe the instructions in this file and not index this page provided by you.

While this method is fairly simple for users with simple coding knowledge, it may not be for newbies.

That’s because any false information added to a robots.txt file will spoil your site’s search engine visibility.

For that reason, if you don’t know coding skills, you may be better off employing any plugin available in WordPress.


This was for the How to Hide a Page in WordPress?





Read Also: How to Write an Article?


- Advertisement -
Latest Articles
- Advertisement -
Related Articles
- Advertisement -