How to hide a WordPress post or page from Google?
Sometimes it may be needed to hide a WordPress post or page from Google to prevent that page or post from unwanted users or for just privacy. So in this article, I am going to show you how you can hide your page or post from Google so that it will not come in the search results.
I am going to show you two different ways to hide a post or page of your WordPress site or blog from google search engine show that it will not show your content on the search results page of Google. All the steps that you need to do are very easy and simple. there are no need to have any coding or programming skills.
Hide WordPress post or page on Google using Yoast SEO plugin
Yoast SEO is so popular SEO plugin for WordPress and lots of users are using it for their WordPress blog or WP site to rank better on search engines.
There is an easy way to hide your post or page on Google search results using Yoast SEO plugin. Just go to the WprdPress page or post editor page which you want to hide from Google. Now scroll down where you can see the Yoast SEO meta box. It is just below the editor box. Then click on advanced settings button.
now select noindex from meta robots index and then select nofollow from meta robots follow. After completing this you can update or save the post.
Yoast SEO plugin will now add the below line of code inside the <head> tag:
<meta name="robots" content="noindex,nofollow"/>
You can see the above code for that page or post if you view the source code on your browser. This will only be added to that particular post or page. So you will not able to find this code on any other pages or posts.
So what the above code will do? The above code tells search engines not to follow and index that particular page or post. Well, with this way, Google will still crawl that URL, but it will not index that page on Google search engine and it will not available in search results.
So was that not easy? You didn’t have to write any code. You have done it within just a few easy to follow clicks. Yoast SEO is really so great plugin. Isn’t it? What do you think?
Hide that page or post using robots.txt file
robots.txt is a text file that placed in the root directory of a website. Search crawlers obeyed by this special text file. robots.txt file tells search engines which page not to crawl.
You can tell Google about and other search engines not to crawl a particular URL or an URL structure. For example, if you want to prevent all of the admin dashboard pages of your WordPress site then you should write the below code inside the robots.txt file:
You can also hide a particular page or post of your WordPress site using your robots.txt file. The code which will do this job looks like below:
User-agent: * Disallow: /your-page/
The above code telling Google search engine not to crawl that particular page.
Now let’s assume I want to prevent this post that you are reading this blog to disable crawling by search engines. So the code to hide this page from google will be:
User-agent: * Disallow: /how-to-hide-a-wordpress-post-or-page-from-google/
Using Yoast SEO Google still will be able to crawl that page or post, but the above line of text inside robots.txt file tells Google not to crawl that URL. So using robots.txt, it is a different process for search crawlers than using Yoast SEO. Google bot will completely ignore that URL from crawling. So that particular post or page will not be indexed by Google.