Have you ever needed to keep a page on your WordPress site out of Google search results? As an experienced website owner, I totally get it.
There are many good reasons you may want to exclude a page from search engines. Let‘s look at a few common scenarios:
-
The page has private member information that only paid subscribers should see. No need to let Google index profiles and personal details, right?
-
The page is a leftover or duplicate that no longer needs to be discoverable. I‘m sure you‘ve come across old pages like this on mature sites.
-
Your site is down for maintenance. Rather than show an error, you want a temporary "Down for Maintenance" page.
According to BuiltWith, WordPress powers over 41% of all websites on the internet. With so many sites relying on WordPress, exclusion from search needs to be done carefully.
The good news is WordPress offers a few straightforward ways to selectively hide pages from Google and other search engines. In this post, I‘ll share the proven techniques I‘ve used over 15 years as a webmaster to effectively control page indexing.
Contents
1. Use a WordPress SEO Plugin for Easy Selective Exclusion
The fastest way to manage search visibility for individual WordPress pages is using an SEO plugin. Top options like Yoast SEO and Rank Math make it a breeze.
Here‘s how to noindex a page in WordPress with Yoast SEO:
- Edit the page you want to hide.
- Expand the "Yoast SEO" metabox.
- Go to the "Indexability" tab.
- Select "noindex" to tell search engines not to index the page.
That‘s seriously all it takes! The Yoast plugin will automatically insert this meta tag in the page header:
<meta name="robots" content="noindex">
When Google crawls the page again, it will see the noindex directive and remove the page from search results.
Benefits of the plugin method:
- It only takes a few clicks to hide or unhide a page.
- No coding needed – the plugin handles everything behind the scenes.
- You can noindex entire WordPress sections like archives or taxonomies too.
The only limitation is needing to have Yoast SEO or Rank Math installed. But a solid SEO plugin should be part of every WordPress site‘s toolkit anyway.
I recommend free versions of Yoast SEO or Rank Math to get started.
2. Block Indexing Via the Robots.txt File
The old school way to hide pages from search engines is by using a robots.txt file. This file gives search bots instructions about your site.
Here‘s how to add page blocking rules to robots.txt:
- Using FTP, access your site‘s root web directory.
- Open the
robots.txtfile in a text editor. - Add a "Disallow" line like this:
Disallow: /url-to-block/
To block http://example.com/private-page/, you would use:
Disallow: /private-page/
- Save changes and upload the file back to your server.
Now Googlebot will see this disallow directive and avoid indexing the specified page.
The main drawback to robots.txt is potential for blocking entire sections of your site by accident. I once used an overbroad rule that blocked everything on a client‘s site!
My recommendation is to use robots.txt only for a quick one-off page block. Rely on a plugin for better control over selectively hiding WordPress content from search engines.
3. Password Protect Pages to Restrict Search Visibility
When you need to limit access to authorized users only, password protection is a great option.
This allows human visitors with the password to view the page while keeping it hidden from search engines. Here‘s how to password protect a page or post in WordPress:
- Edit the page and go to the "Document" tab.
- Under Visibility, select "Password protected" and enter a password.
- Update the page to apply password protection.
Now only users who enter the password you set will be able to access the page content. Search bots won‘t see the protected content at all.
The advantage of password protection is retaining full access control without needing plugins. However, it can be annoying for users to enter passwords just to view content.
My advice is to use passwords sparingly for pages that truly need restricted access like member profiles or special promotions.
Wrap Up
To quickly recap how to hide WordPress pages from Google search:
-
Use SEO plugins like Yoast or RankMath for easy noindexing of individual pages.
-
Block page crawling in robots.txt for a quick one-off hide.
-
Password protect sensitive pages to limit visibility.
Hiding pages judiciously won‘t harm your overall search rankings. But deindexing should be done selectively to avoid losing relevant traffic.
I hope these insider tips from my 15 years of WordPress experience help you control search visibility! Let me know if you have any other questions.
