January 30

How to Hide a WordPress Page from Google

21  comments

61% of marketers say improving SEO and growing their organic presence is their top inbound marketing priority.

As a WordPress site owner, you likely share this priority and dedicate a lot of time and energy to making sure that your content is found by search engines.

However, there are a number of reasons why you might want to hide some of your content from search results. If you’re having an invitation-only event, for example, then you don’t want visitors to find the page with the RSVP link in a SERP. Or you may have pages with sales presentations or internal communications that are only for internal use.

Whatever the reason, you have a few options for hiding a WordPress page from Google. In this post, we'll show you how.


There are two options for hiding a WordPress page from Google. You can edit the robots.txt file in the control panel of your hosting account. However, since making a mistake in this file can negatively impact your site’s SEO, this method is recommended for more advanced users. Beginner users who lack coding experience can use the Yoast SEO plugin to tell Google not to index certain pages on their site.


We’ll discuss each of these methods in detail below so you can choose the one that best meets your level of technical expertise.

Use Robots.txt File to Hide WordPress Pages From Google

To hide certain pages from Google, you can edit the robots.txt file in the control panel of your hosting account. Robots.txt is a file located in the root directory of your site that tells Google and other search engine bots which posts and pages to crawl.

To access it, log into your hosting account’s cPanel and click the File Manager icon under the Files section.

In the navigation menu on the lefthand side of your screen, click on the public_html folder. Locate the robots.txt file and click Edit from the menu at the top of your screen.

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

Please note that you’ll need to replace the placeholder text in the Disallow field with the URL path of the page you want to hide. The path is everything after your domain name.

Say, for example, the URL of the page you want to hide is http://www.yoursite.com/2020/1/pricing-page/. Then the code snippet you’ll add to your robots.txt file will look like:

You can leave the User-agent field as is since the asterisk means any web crawlers will be instructed not to index this page. If you’d like to hide this page from Google only, then replace the asterisk with “Googlebot” in the user-agent field. Doing so will allow other search engine bots to index the page.

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

Google search crawlers will now follow the instructions in this file and not index this page.

While this method is relatively simple for users with some coding knowledge, it may not be for beginners. That’s because any incorrect information added to a robots.txt file will harm your site’s search engine visibility. For that reason, if you don’t have coding skills, you may be better off using a plugin.

If you’d like to avoid coding altogether, you can use the Yoast SEO plugin to hide pages from Google. To start, install and activate the plugin on your WordPress site.

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 Google.

Scroll down to the Yoast SEO meta box below the post editor. Along the left side of this window, click on the gear icon to open the plugin’s advanced settings.

Here you can add meta tag robots to tell search engines like Google not to index or follow the page.

Just select Noindex from the drop-down menu under “Meta robots index.” Then click Nofollow under “Meta robots follow.”

You can now save or publish the post. Yoast SEO will add a line of code to the page that looks something like:

<meta name="robots" content="noindex,nofollow"/>


Search engines will now be instructed not to follow or index this page. If you’d like to hide this page from Google only, and not all search engines, then replace “robots” with “Googlebot.”

While the above methods will prevent certain pages from appearing in Google search results, any visitors who have (or can guess) the link will still be able to view this content. If you’d like to hide this content from visitors, then you can set up a password to protect it.

There’s no need to install a plugin. WordPress comes with 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 to the Publish meta box. Then click the link labeled “Edit” next to the Visibility option.

Select the “Password protected” option and fill in your password in the empty input box.

Once you click the Publish button, only users who know the password will be able to view the page.

Using either of the methods above will enable you to hide a WordPress page from Google search results. Controlling which pages are visible in search and which are hidden will help ensure you put the right content in front of the right people.


Tags


You may also like

Jordan
Jordan
Jordan
Leave a Reply
  1. I like the valuable info you provide in your articles.

    I’ll bookmark your blog and check again here frequently.
    I’m quite certain I’ll learn many new stuff right here!

    Good luck for the next!

  2. Wonderful blog! I found it while searching on Yahoo
    News. Do you have any tips on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!
    Thank you

  3. I think this is one of the most important information for me.
    And i’m glad reading your article. But want to remark on some general things, The web site style is perfect, the articles is really
    excellent : D. Good job, cheers

  4. I think this is among the most important info for me.
    And i am glad reading your article. But want to remark on few general things, The web site
    style is ideal, the articles is really great : D. Good
    job, cheers

  5. A motivating discussion is definitely worth comment.
    I do believe that you should write more on this issue, it might not be a taboo subject but
    typically people don’t discuss such issues. To the next!
    Cheers!!

  6. Hmm is anyone else experiencing problems with the pictures
    on this blog loading? I’m trying to find out if its a problem on my end or if it’s the blog.
    Any feedback would be greatly appreciated.

  7. I have been surfing online more than 3 hours today,
    yet I never found any interesting article like yours. It’s pretty worth enough for me.
    In my view, if all website owners and bloggers made good content as you did, the internet will be a lot more useful than ever before.

  8. Hey would you mind stating which blog platform
    you’re working with? I’m going to start my own blog soon but I’m having a difficult time choosing between BlogEngine/Wordpress/B2evolution and Drupal.

    The reason I ask is because your design and style seems different then most blogs and I’m looking for something completely unique.
    P.S My apologies for being off-topic but I had to ask!

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}