What Is the Best Way to Hide a WordPress Page From Google?


Do you want to keep a WordPress page hidden from Google?

You may need to exclude a page from Google search results if it is irrelevant to the content of your site, to protect your privacy, or to keep unwanted visitors away.

We’ll show you how to hide a WordPress page from Google without affecting the overall search engine optimization (SEO) of your site in this article.

Why would you want to keep a WordPress post or page hidden from Google?

Website owners can exclude content from search results on search engines like Google.

You can hide WordPress blog posts and pages that aren’t relevant to the general public, such as a page you might need to create to verify website ownership.

You can prevent search engines from indexing your members’ profile pages. If you have a membership website, you can also benefit from excluding WordPress pages from search results.

Hiding content from Google is also useful if your website is still in development and you want to give your audience a sneak peek. This prevents Google from indexing an incomplete website in its search results.

Furthermore, excluding pages containing private or sensitive information protects your privacy and prevents confidential information from falling into the wrong hands.

In this article, we’ll go over how to hide WordPress pages from Google using HTML meta tags, robots.txt files, and password protection.

You have the option of selecting the method that best suits your needs:

  • Method 1: Use AIOSEO to hide a WordPress page from search engines (recommended).
  • Method 2: Use the robots.txt file to hide a WordPress page from search engines.
  • Method 3: In WordPress, password-protect a post or page.

Method 1: Using AIOSEO to Hide a WordPress Page from Search Engines

This is the simplest method and is recommended for beginners.

Using a WordPress plugin like All in One SEO (AIOSEO), you can hide a WordPress page from Google. It’s one of the most widely used SEO plugins, with over 2 million websites using it.

The AIOSEO plugin must first be installed and activated. See our step-by-step guide to installing a WordPress plugin for more information.

You can also use the AIOSEO plugin’s free version, which includes the ability to hide pages from Google.

You must edit the page or post that you want to hide from Google after installing and activating the plugin on your WordPress site.

Simply scroll down to the AIOSEO Settings and click the ‘Advanced’ tab in the WordPress content editor.

You’ll now see a Robot Setting option as well as a Use Default Settings toggle. To turn off the Robot Setting, you must click the toggle.

More options will appear under the Robots meta once you’ve done that. You must check the box that says No Index to prevent the page from appearing in Google search results.

AIOSEO will add a line of code that tells search engines like Google that this page should not be indexed. After that, you have the option to save or publish your page.

This is how the automatic code will look:

Aside from excluding specific pages from Google, AIOSEO also allows you to hide different sections of content.

To do so, log into your WordPress admin area and go to All in One SEO » Search Appearance.

Content Types, Taxonomies, Media, and Archives are among the tabs available for different content sections.

Toggle the Show in Search Results setting to No on any of these tabs.

You’ll need the AIOSEO Pro version to see the options under the ‘Media’ tab if you want to hide media files from Google.

Then, press the ‘Save Changes’ button.

AIOSEO will add a noindex HTML meta tag to the content, preventing search engines from indexing it and preventing it from appearing in search results.

The content will also be removed from your XML sitemaps.

Method 2: Use the robots.txt file to hide a WordPress page from search engines.

This method necessitates the modification of the robots.txt file. Incorrect instructions in this file can have a negative impact on your site’s SEO, which is why it is not recommended for newbies.

The name robots.txt comes from the fact that it allows a website to provide instructions for search engine bots. The robots.txt file is a configuration file that you can place in the root directory of your WordPress site.

Check out our guide on how to optimize your WordPress robots.txt for SEO for more information.

Connect to your website using an FTP client or the ‘File Manager’ in your WordPress hosting cPanel to edit the robots.txt file.

These lines must be added to your robots.txt file.

Allow: /your-page/ User-agent: *

To include all search engines, we use the asterisk sign. You can use the user-agent line to target specific bots.

The following line specifies the part of the URL that follows your domain name.

Let’s pretend you want to hide a blog post with the following URL:

http://example.com/2016/12/my-blog-post/ http://example.com/2016/12/my-blog-post/

This is how you’ll include this URL in your robots.txt file.

Allow: /2016/12/my-blog-post/ User-agent: * Disallow: /2016/12/my-blog-post/

Remember to save your changes and re-upload the robots.txt file to your server.

Use of robots.txt to Hide Content Has Drawbacks

Anyone can directly access it to see if there are any pages you’re attempting to conceal. First and foremost, keep in mind that the robots.txt file is open to the public.

While the instructions in the robots.txt file are followed by most search engines, many other crawlers and bots may simply ignore it. These are the bots that crawl the internet in order to spread malware, target websites, or collect information such as email addresses and phone numbers.

Method 3: Password-Protect a WordPress Post or Page

This method employs a unique strategy. Instead of asking search engines not to index a page, you can password protect it so that only users who know the password can see it.

WordPress has a built-in password protection feature for posts and pages. Simply make a change to the post or page you want to protect.

Click the link next to the ‘Visibility’ option in the Document setting in your WordPress editor.

A post/page can be made public, private, or password protected. This will display all of WordPress’s visibility options.

Only logged in users with at least the editor user role on your website have access to private posts.

Enter a strong password after selecting the password protected option. Any visitor with the password can view password-protected posts.

Your post/page is now ready to be published or saved.

Visitors to your website’s post or page will now be prompted to enter the password in order to view the content.

See our guide on how to password protect posts and pages in WordPress for more information.

If you want to create and sell online courses, we recommend using a platform like MemberPress, which includes advanced content security features.

That’s all there is to it; we hope this article has shown you how to hide a WordPress page from Google. You might also be interested in our comparison of the best drag & drop page builders for WordPress, as well as our guide on how to install Google analytics in WordPress to see user statistics.

You can also find us on social media sites such as Twitter and Facebook. Please subscribe to our YouTube Channel for WordPress video tutorials if you enjoyed this article.

  • 15 Things You Must Do Before Changing WordPress Themes Checklist

    How to Fix the WordPress Error Establishing a Database Connection

  • Why is it so important to build an email list today? (6 Reasons)

    Step-by-Step Instructions for Starting Your Own Podcast

    Editorial Staff Information

    Over 1.3 million readers around the world rely on it. WPBeginner’s Editorial Staff is a group of WordPress experts led by Syed Balkhi.

    How long does it take for AIOSEO to re-index the page after I add the no-index meta tag to the AIOSEO settings if I want the page to appear publicly on Google searches in the future?

    This was useful for not indexing pages like Privacy Policies and Terms of Service, which are largely useless to Google. The most straightforward method is to use YOAST. There’s no need for a code; simply change the setting and you’re good to go.

    Thank you for letting us know which method you prefer from our article.

    Will a page that has been set to Private visibility be indexable for SEO purposes but not appear on the site map?

    Normally, a private post would not be indexed.

    How long does it take for the page to stop appearing in Google searches after you make these changes?

    It would depend on when Google’s cache is cleared.

    So I’m guessing Yoast changed the look since this was originally published. The settings for the Yoast plugin differ from what is shown in the image.

    Would I have to use Method #2 above to accomplish this? I’m trying to figure out how to keep an opt-in PDF file (media) out of Google searches. Thank you very much! The above appears to only refer to pages/posts.

    You’ll probably need to use method #2 from the article for what you’re looking for.

    I’d like Google to remove my site’s member pages from its index. You can make the ‘member’ page noindexed by following the steps below. The single member pages, however, continue to appear. Are there any solutions you can suggest? Thank you for writing this article.

    Thank you.

    However, could you please tell me how long it will take to remove these pages from Google’s search results? Hello, I’d like to remove some of the pages from the index. The yoast method, in my opinion, is the best.

    Hello, Farukh.

    Search engines, on the other hand, decide when to update their index. It usually takes no more than a few minutes.

    Hello there. I have password-protected pages on my website that are somehow showing up in Google search engine results, bypassing the password and displaying the pages to the viewer without requiring a password.

    Kim’s advice on passwords was unsettling. I’d like to direct people to a secure page that isn’t found on Google or any other search engine. I’m curious if one of these methods is preferred, or if you need to use more than one for a pricing page, for example. I’d also like to hear your thoughts on that. Thank you for the excellent article.

    Hello, Karen.

    As soon as your page is published, this method will make it noindex for Google. You can use method 1 to ensure that the page will not be indexed by Google.

    Customers should not be able to see the mobile page. How can I prevent a page I created for the mobile site from appearing in my search results?

    If I understand correctly, if you use method 3 and password protect a page, it is still indexed, but only those who know the password can view it.

    So I don’t think password protection is enough – we should probably use one of the first two methods to keep it hidden as well. Do you agree with me? However, I received a message on my phone from Google informing me that a website I had recently visited had been updated – but with the caveat that it was password protected. This isn’t something I’d want anyone else to get because they wouldn’t be able to access the page, which would be annoying rather than useful. My colleague recently created a draft page for another colleague to review (using a password) with the intention of keeping it hidden.

    This is straightforward, concise, and easy to understand. Thank you very much. Thank you for a fantastic article. You’ve been added to my favorites list!

    When I search for my domain name, the deleted page comes up… Yoast, on the other hand, submitted an XML sitemap to Google, which was indexed in search results. More than 20 posts have been removed from my WordPress blog.

    The message reads, “404 content not found.” If I navigate to that page.

    Is there any way to get rid of it quickly?

    Using Google Webmaster Tools, try to detach them. It could be beneficial.

kiuz
Logo
Enable registration in settings - general