Are you looking for a way to hide a WordPress page from Google?
Sometimes you may need to exclude a page from appearing in Google search results as it is not relevant to your site’s content, to protect your privacy, or to keep away unwanted users.
In this article, we will show you how to hide a WordPress page from Google without affecting your site’s overall search engine optimization (SEO).
Why Hide a WordPress Post or Page from Google
Search engines like Google allow website owners to exclude content from search results.
For example, you might want to hide WordPress blog posts and pages that don’t have any relevance to the general public, such as a page you might have to create for website ownership verification.
You may also wish to exclude pages that have private or sensitive information to protect your privacy and prevent confidential information from falling into the wrong hands. For example, if you have a membership website, you can hide the profile pages of your members from appearing on search engines.
Hiding content from Google is also helpful if your website is under development and you want to share a sneak preview with your audience. That way Google won’t index an unfinished website in its search results.
In this article, we will cover different ways to hide WordPress pages from Google including using an HTML meta tag, using your robots.txt file, password protecting your pages, and placing your site in maintenance mode.
- Method 1: Hide a WordPress page from search engines using AIOSEO (Recommended)
- Method 2: Hide a WordPress page from search engines using robots.txt file
- Method 3: Password protect a post or page in WordPress
- Method 4: Hide a WordPress site until it is ready
Method 1: Hide a WordPress Page from Search Engines Using AIOSEO
You can hide a WordPress page from Google by using a WordPress plugin like All in One SEO (AIOSEO). It’s one of the most popular SEO plugins used by over 2 million websites. This method is the easiest and recommended for beginners.
First, you need to install and activate the AIOSEO plugin. For more details, see our step by step guide on how to install a WordPress plugin. The free version of AIOSEO also comes with the ability for you to hide pages from Google.
After installing and activating the plugin on your WordPress site, you need to edit the page or post that you want to hide from Google.
In the WordPress content editor, simply scroll down to the AIOSEO Settings and click on the ‘Advanced’ tab. You will now see a ‘Robots Setting’ option and a toggle that says ‘Use Default Settings’. You need to click on the toggle to switch off the robots setting.
Once you do that, more options will appear under Robots meta. To exclude the page from appearing in Google search results, you need to check the box that says ‘No Index’.
After you select that, you can save or publish your page. AIOSEO will add a line of code that tells the search engines like Google to not index this page.
The automatic code will look like this:
<meta name="robots" content="noindex"/>
Aside from excluding specific pages, AIOSEO also lets you hide different sections of content from appearing on Google. To do that, go to All in One SEO » Search Appearance from your WordPress admin area.
You will see different tabs for different content sections, including Content Types, Taxonomies, Media, and Archives.
Now click on any of these tabs and set the ‘Show in Search Results’ setting to ‘No’.
If you want to hide media files from Google, then you will need AIOSEO Pro version to view the options under the ‘Media’ tab.
After that, click the ‘Save Changes’ button.
AIOSEO will add a ‘noindex’ HTML meta tag, so the search engines will not index the content, and it will not appear in the search results. It will also exclude the content from your XML sitemaps.
Method 2: Hide a WordPress Page from Search Engines Using robots.txt File
This method requires you to edit the robots.txt file, which is a configuration file that provides instructions to search engine bots. For more information, take a look at our guide on how to optimize your WordPress robots.txt for SEO.
Adding incorrect instructions in this file can have a negative effect on your site’s SEO, which is why we don’t recommend this method to beginners.
You will need to add these lines to your robots.txt file:
User-agent: * Disallow: /your-page/
The user-agent line allows you to target specific bots. We are using an asterisk sign to include all search engines. The next line defines the part of the URL that comes after your domain name.
Now let’s assume that you want to hide a blog post with a URL like this:
Here is how you will add this URL to your robots.txt file:
User-agent: * Disallow: /2016/12/my-blog-post/
Don’t forget to save your changes and upload robots.txt file back to your server.
There are some disadvantages to using robots.txt to hide content. First, keep in mind that robots.txt file is publicly accessible. That means anyone can access it directly to see if there are any pages you are trying to hide.
Second, while most search engines follow the instructions in robots.txt file, other crawlers and bots may simply ignore it and index those pages anyway. These bots crawl the web to spread malware, target websites, and harvest information like email accounts and phone numbers.
Method 3: Password Protect a Post or Page in WordPress
This method uses a different approach. Instead of asking search engines not to index a page, you can simply password protect it, so that it is only visible to users with the password.
WordPress comes with a built-in feature to password protect posts and pages. Simply edit the post or page that you want to protect. 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 where you can make a post or page public, private, or password protected.
Private posts are only available to logged in users who have at least an editor user role on your website. Password protected posts can be seen by any visitor who has the password.
You need to click on the ‘Password Protected’ option and then enter a strong password.
Once you publish or update the post or page, visitors who try to access it will be asked to enter the password to view the content.
For more detailed instructions, see our guide on how to password protect posts and pages in WordPress. If you’re looking to create and sell online courses, then we recommend using a proper platform like MemberPress which comes with advanced content protection features.
Method 4: Hide a WordPress Site Until It Is Ready
You might want to hide your WordPress site from Google and the public when you are building it, redesigning it, or doing major theme and plugin updates. The easiest way to do this is to place your website in maintenance mode using a plugin like SeedProd.
Note: There is a free version of SeedProd available as well that you can use, but for this tutorial, we’ll show the Pro version since it has more features.
Upon activation, head over to the SeedProd » Settings page to enter your license key. You can find this information under your account on the SeedProd website.
Next, you need to navigate to SeedProd » Pages. Here you should look for the ‘Maintenance Mode’ page and switch the toggle from ‘Inactive’ to ‘Active’.
After that, you’ll need to click on the ‘Set up a Maintenance Mode Page’ button. This lets you create a temporary page that your visitors can see while your website is hidden.
First, you need to choose a template for the page. When you hover your mouse over a template you’ll see two icons. You can preview the template by clicking the magnifying glass icon, and select it by clicking the red tick icon.
After selecting a template you’ll be taken to the SeedProd drag and drop page builder to customize your maintenance mode page. Here you can edit the text and upload a custom background image to match your branding.
You can also add new blocks from the left column. For example, you might like to add a timer that counts down to the launch of your website.
Once you’re happy with the page design you need to publish it. Simply click the drop down menu button next to ‘Save’ and then click ‘Publish’.
You’ll be shown a message that your page has been published. Your website is now hidden from Google and the public and only the maintenance page is visible.
You can click the ‘See Live Page’ button to view your maintenance page. This is how it looks on our demo website.
Once you’re ready to show your website to the world, then simply visit SeedProd » Pages again and switch the Maintenance Mode toggle from ‘Active’ to ‘Inactive’.
We hope this tutorial helped you learn how to hide a WordPress page from Google. You may also want to see our guide on how to install Google analytics in WordPress to see user stats, and our comparison of the best drag and drop page builders for WordPress.