3 Methods to Hide a WordPress Page from Google

3 Methods to Hide a WordPress Page from Google

Ranking high in search engine results is every site owner’s goal. To achieve that goal, we apply several optimization techniques and do our best to convince search engines your content is relevant and valuable. On the other side, sometimes you may need to hide a WordPress page from appearing in Google and other search engines’ search results as it is not relevant to your site’s content, to protect your privacy, or to keep away unwanted users. Whatever your reason behind hiding a page, you can do that easily with WordPress.

In today’s article, I am going to introduce you to three different methods that allow you to hide your WordPress page from Google and other search engines.

When You Should Hide a WordPress Page from Search Engines?

There are several reasons you would like to hide your pages from Google and other search engines. Some of them are:

  1. If your website features ads and similar content that is generated by third-party sources, you should hide it from search engines. Suppose you purchased an online ad that, once clicked on, redirects to a specific landing page. Your goal is to monitor how many new customers the ad attracts. If Google indexes the landing page, site visitors will be able to access it directly from their search results. This will make it all the more difficult for you to track how effective the ad was. So, you should hide these types of pages.
  2. If publish your content in several formats (for instance, Adobe PDF or printer-friendly versions), you should show just one version to search engines to avoid duplicate content issues. Also, e-commerce sites should hide pages that have identical descriptions of the same product that vary only in color, size, etc.
  3. Every website contains pages that have nothing to do with the main purpose of a site and have no practical value to a viewer. Thank You pages, admin login pages, registration forms, privacy policy pages, and similar types of pages are not that important for users, so it’s not necessary to have them ranked in search engine results.
  4. Nobody wants to share pages that contain personal information, confidential company details, information about alpha products, users’ profile info, private correspondence, registration or credential requirements.
  5. In case your pages are under development, you must keep them hidden from search engines until they are fully ready.

How to hide a WordPress page from Google:

Now, we will show you how you can hide a WordPress page from search engines.  There are three different methods we will discuss today. You can choose the one suitable for your site. So, let’s have a look at those methods:

Method 1:  Using Yoast SEO

Using Yoast SEO is the easiest option to follow when you are going to hide your page from search engines. If you’d like to avoid coding altogether, you can use the Yoast SEO plugin to hide pages from search engines. Aside from its simplicity, this method proves to be effective and safe as well.

To use this method, you need to install and configure the Yoast plugin. Once it’s been successfully installed and activated, navigate to ‘Pages > All Pages’ in your WordPress dashboard to edit the page you would like to hide from search engines. Scroll down to the Yoast SEO meta box below the post editor. Go to the Yoast SEO box and click the ‘Advanced Settings’ button.

Hide a WordPress  Page Using Yoast SEO

Several options will appear, but we’re interested in the top two. The first one allows you to prevent search engines from showing your page in search results, and the second one stops search engines from following links on your page. So, select ‘No’ under both ‘Allow Search Engines to Show this Post in Search Results?’ and ‘Should search engines follow links on this page?’.

Hide a WordPress  Page Using Yoast SEO

Now, search engines will be instructed not to follow or index this page.

Method 2: Using the robots.txt File

As adding incorrect instructions in this file may affect your site’s search engine visibility, this method is not recommended for beginner users.

You can use an FTP account or use the File Manager app from the hosting account or plugins to edit the robot.txt file. Connect your WordPress hosting account using an FTP client, you will be able to see the robots.txt file present in your website’s folder.

Hide a WordPress  Page Using robot.txt File

If you don’t have an existing file, you can create one and edit it. You can initially download the robot.txt file on your desktop and with the help of any plain editor, you can create one.

Hide a WordPress  Page Using robot.txt File

Also, you can create a robot.txt file with Yoast SEO. You need to go to SEO, select the ‘Tools’ button present on the WordPress admin, and then click on the file editor link. A new page will appear, where the Yoast SEO page will show if you have already an existing robots.txt file. If you don’t have then Yoast SEO will automatically generate a new robots.txt file for you.

Hide a WordPress  Page Using robot.txt File

Whichever way you follow, to hide a page from Google and other search engines via the robots.txt file, add the following lines of code to the file:

User-agent: *
Disallow: /the-URL-of-your-page/

The first line of code allows you to target specific bots and search engines. To include all search engines, you have to use an asterisk sign. On the second line, insert the URL of the page you would like to hide.

Make sure to exclude your website’s domain name.

For example, if the page URL is:


You would put:

User-agent: *
Disallow: /2021/17/x-y-z 

Click Save and upload the updated robot.txt file to your server.

Why We Don’t Recommend Using the robots.txt File to a Hide Page?

As we mentioned, we don’t recommend this method. The reason is, aside from not being beginner-friendly, this method also comes with a few risks. Firstly, robot.txt files are made accessible to the public. Therefore, hackers can find your hidden files even if they don’t appear in Google and other search engine results.

Secondly, although most search engines follow the instructions in the robots.txt file, but not all search engines follow the requests of this file. These are the bots that crawl the web to spread malware, target websites or harvest sensitive information.

Method 3: Password Protect the Page

Here is the last method of hiding a WordPress page, we will talk about. With this method, you can allow Google and other search engines to index and follow your website. But it will only be visible to users who know the password.

With this method, you don’t need to install any plugins. WordPress has a built-in password protection feature for pages and posts. You just need to navigate to the page that you want to protect and go under the Document setting in your WordPress editor, click on the link next to the ‘Visibility’ option. This will show the visibility options available in WordPress. You can keep a post/page public, make it private, or password-protect it.

Password Protect your Page

Choose ‘Password Protected’ and create a strong password.

Password Protect your Page

Then click on the ‘Publish’ button. Now, only users who know the password will be able to view the page.


We highly recommend method 1 for hiding a WordPress page from Google. But you can experiment with other options, too. In the end, all that matters is that you succeed in preventing search engines from accessing and indexing your WordPress page using whatever method you feel most comfortable with.

So, that’s all, hope this article helped you to learn how to hide a WordPress page from Google and other search engines. Also, just check out our blog post section to get more helpful tips and tricks.

Leave a Reply