Are you wondering if it is possible to hide a page of your WordPress website from Google? Sometimes it is necessary to hide some of your website pages from Google to ensure site privacy and keep unwanted users away. In this article, we will explain to you how to remove or hide any WordPress page or post from Google search engine without hampering your website’s overall SEO.
How to hide a WordPress page or post from Google?
If your website is indexed by Google, it is a great sign of SEO growth. However, Google also allows you to exclude some pages of your website, as per your requirements. This can be done by either using HTML meta tags or the robots.txt file.
We will start with discussing two different methods of hiding WordPress page or post. However, if you do not find either of the two options the right fit for your needs, we will also explain how you can password protect your pages and posts. Password protection allows you to control your website’s page and post visibility for every user.
Use Yoast SEO to hide WordPress pages from Search Engines
This method is recommended for beginners, as handling Yoast SEO is quite easy. To start, install and activate the Yoast SEO plugin on your WordPress site.
Once you are done with the installation and activation, you need to edit the page or post you would like to hide from Google and other search engines. Scroll down to Yoast SEO meta box, under the post editor and click the “Advanced Settings” button.
The Advanced settings section will allow you to add meta tag robots to your site pages and posts. By using the robots meta tag, you tell search engines like Google not to index or follow a page.
Select “Noindex” from the drop-down menu next to the “Meta robots index” option (as seen above). Then you need to click on “Nofollow” beside the “Meta robots follow” option. Once ready, click save or publish to update the new code in your page or post. Yoast SEO will then add a line of code to the page or post you are trying to hide from search engines. The code looks somewhat similar to this:
<meta name="robots" content="index"/>
Place this meta tag in the <head> section to restrict almost every search engine or web crawlers from indexing any page of your site manually. If you want to index the web page on the search engines but do not want the spiders to follow it, use this code:
<meta name="robots" content="nofollow"/>
To restrict any search engine, you will have to use the name of the search engine, instead of “robots”. For example, if you want to manually restrict only Google web crawlers from indexing or to follow a page use:
<meta name="Googlebot" content="index/nofollow"/>
<meta name="Googlebot" content="index,nofollow"/>
Use robots.txt file to hide WordPress pages from Search Engines
If you are a beginner, we do not recommend you use this method as this approach requires coding skills and any mistakes can have adverse effects on your website.
In this method, you will have to edit the robots.txt file. This is a configuration file that can be added to the root directory of your WordPress site. It provides instructions on a website to various search engine bots and it is universally known as robots.txt. Any incorrect information added to this file can confuse the search engine bots and harm the site’s search engine visibility
You can either edit the robots.txt file by using FTP client or the “File Manager” of your WordPress cPanel. To stop indexing any page or to hide a page add this code to the robots.txt file:
The “Asterisk” sign is used to include all online search engines. If you want to remove or hide the page from any particular search engine, you can add its name. This line of the code will allow you to target bots and the next line explains that part of the URL, which is written after your domain name. For example, if the full-page link looks somewhat like this:
The URL you add to the robots.txt file should be like this:
Once you are done with the coding, save the changes and upload the robots.txt file to the server.
There is no doubt that this method is very effective, but there are some disadvantages attached to it. Remember robots.txt is a publicly accessible file, and anyone can directly check which files you are trying to hide. Although most of the search engines follow the instructions mentioned in robots.txt, some web crawlers and bots simply ignore this file and its content. Any bot moving around the Internet to target websites and spread malware or harvest information, will not read the instructions provided by robots.txt.
Password Protection for Pages or Posts in WordPress
In this method, instead of commanding search engines to not follow or index a page or post, users can input a password to protect it. In this case, only the users who know the password will be able to access the protected posts or pages.
You do not need to install any plugin for this as WordPress comes with built in password protection feature for pages and posts. You just need to edit the page or post that you want to protect.
To do this, go to the “Publish” meta box and click the “Edit” link next to the “Visibility” option.
Here, you will get different visibility options available in WordPress. As per your requirements, you can choose between public, private, and password protected. Private posts can be accessed by logged in users only. On the other hand, password protected pages or posts is visible to all visitors who have the password. To complete the process, under the Visibility tab, select the “Password protected” option and fill in your password, in the empty input box.
Publish or save the page or post to preview online.
All the methods mentioned above are useful, but all of them has their own set of restrictions. Before you start hiding or removing any of your site pages or posts from Google, choose your preferred method carefully.
Know Everything About WordPress
Best Products in Your Inbox
Subscribe to our mailing list and we will surprise you with amazing WordPress freebies
Thank you for subscribing.