Skip to Main Content

How to prevent Google from indexing a WordPress page

Divi: the easiest WordPress theme to use

Divi: The best WordPress theme of all time!

With over 901.000 downloads, Divi is the most popular WordPress theme in the world. It is complete, easy to use and comes with more than 62 free templates. [Recommended]

Recently one of our readers asked us if it is possible to hide a WordPress page from Google. 

Sometimes you may want to hide a Google page to protect your privacy or to keep unwanted users away.

In this tutorial, we will show you how to hide a Google WordPress page without affecting the overall SEO of your website.

How to prevent google indexing wordpress page

Hide a WordPress page or article for Google

The search engine like Google allow website owners to exclude content from search results. You can do this by using the robots.txt file from your website or by using tags goal.

We will show you how to do this on WordPress using two methods. You can choose the one that works best for you.

We will also show you how to protect an article or page with a password. If you do not want to use the first two methods, then this approach will allow you to control the visibility of your articles and pages for all users.

You can go further by discovering How to prevent Google from indexing a WordPress page

1 Method: Hide a WordPress Page with Yoast SEO for Google

This method is easier and recommended for beginners.

The first thing you need to do is to install and activate the plugin " Yoast SEO ».

For more details, see our step-by-step guide on how to install a WordPress plugin.

If you are new to Yoast SEO, then check out our guide on how to install and configure the Yoast SEO plugin

Then you need to edit the post or page that you want to hide from search engines. Scroll down to the meta section " Yoast SEO »And click on the button« Advanced».

Yoast seo configuration

This section allows you to add tags for robots. Using the option " Meta robots advancedYou will be able to tell search engines not to index or follow a page.

Then you have to select " noindex "In the drop-down menu next to the" Meta robots index ". After that, click on " nofollow " beside " Meta follow robots ».

You can " save / publish Your article or page.

Easily create your website with Elementor

Elementor allows you to easily create any website design with a professional look. Stop paying expensive for what you can do yourself. [Free]

Yoast SEO will add this line of code to your article or page:

It simply tells search engines to not track or index a page.

2 Method: Hide a page from search engines using the robots.txt file

This method requires you to edit the robots.txt file. Adding incorrect instructions to this file can have bad SEO effects on your website, which is why it is not recommended for first-time users.

The robots.txt file is a configuration file that you can add to the root directory of your WordPress website. It allows a website to provide instructions to search engine spiders, hence the name robots.txt.

See also How to optimize your WordPress Robots.txt file for SEO

You can edit the robots.txt file by logging into your website using an FTP client orFile managerIn your cPanel.

You will need to add these lines to your robots.txt file.

User-agent: * Disallow: / your page /

Line " User Agent Allows you to target specific robots. We use the asterisk sign to include all search engines.

The next line defines the part of the URL that comes after your domain name.

Now, suppose you want to hide a blog post with a URL like this:

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

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 the robots.txt file to your server.

Disadvantages of using robots.txt file to hide content

First, you need to keep in mind that the robots.txt file is publicly available. Anyone can go directly to it to see if there are any pages you are trying to hide.

Are you looking for the best WordPress themes and plugins?

Download the best plugins and WordPress themes on Envato and easily create your website. Already more than 49.720.000 downloads. [EXCLUSIVE]

While most search engines follow the instructions in the robots.txt file, many other bots may simply ignore it.

These are the robots that explore the Web to spread malware or to collect information such as email addresses, phone numbers, etc….

By the way, if your website shows signs of slowness, discover our 10 WordPress plugins to improve the speed of your blog

If these methods are not enough for you, we suggest the latter which seems radical, but it does exactly what you expect.

How to protect an article / page with a password

We have already proposed A tutorial on that you can read. The peculiarity with this practice is that it blocks access to content to all those who do not have a password including robots.

It may be good practice, if you think that the use of robots.txt Is not effective.

If you think that your blog or website has a security deficit, we offer 3 Premium WordPress plugins that will protect you.

1. Smart Security Tools

Smart Security Tools is a very effective WordPress plugin for improving the security of your website. It has a set of tweaks and tools for additional protection coupled with a security advisor who can help you determine what needs to be done.Smart security tools wordpress security plugin

The plugin integrates antiviruses such as Whole virus et Sucuri which are responsible for scanning and detecting malware on your website. You also have a security log from which you can ban certain IP addresses.

It also has a large number of premium extensions to expand the range of its features.

Download | Demo | Web hosting

2. WP Malware Scanner

WP Scanner is a daily automatic malware scanning service. Security Platform Also Offers One-Click Malware Cleanup Service and Ongoing Website Protection | No false positive. 

Its features are: early detection of malware, detection of hard-to-find malware, automatic one-click cleanup, scanning for malware that does not overload your server, connection protection, a firewall. web application, secure and comprehensive backups of your website, real-time malware detection, custom keywords for scanning, detailed reports, and more

Download | Demo | Web hosting

3. WP-SpamShield

WP-SpamShield is a powerful WordPress spam fighting plugin, it works in the background and does not offer any captcha on your WordPress website.Wp spamshield anti spam wordpress plugin

It protects your comments form, but also your registration form and all other elements likely to receive spam. In the beginning this plugin was free, but today with its 4 million downloads it has become one of the most popular WordPress plugins in the fight against spam.

Easily create your Online Store

Download free WooCommerce, the best e-commerce plugins to sell your physical and digital products on WordPress. [Recommended]

Your website will be much safer once you start using this plugin. As already mentioned, it does not add anything, like an annoying Captcha or a spam protection issue, but it runs in the background silently to protect your 24 / 7 website.

Download | Demo | Web hosting 

Other recommended resources

We also invite you to consult the resources below to go further in the grip and control of your website and blog.

Conclusion

Here ! That's it for this tutorial dedicated to helping you prevent Google from indexing a WordPress page. feel free to share the tip with your friends on your social networks.

If you have any suggestions or remarks, they will be welcome. We also invite you to consult our resources if you are a beginner blogger.

... 

This article features 6 comments

  1. blocking the indexing of seo yoeas is False information as there is no yoast sign and there is no "ADVANCED" sign here information shows INCOMPETENCE AND YOU ARE ABOVE GOOGLE ENGINE GOOGLE BECOME DES UNNECESSARY WINDOWS !!!

  2. EVEN THE ARTICLE PROTECTION PROCEDURE WITH A PWD DOES NOT WORK…. IN NO CASE THERE IS A WAY TO REMOVE THE CACHE PAGES OF GOOGLE AND MORE THAT WHEN YOU CLOSE THIS PAGE ALSO APPEARS AN AUTOMATIC PAGE THAT IS NOT INTERESTED WE TYPED ON THE SEARCH ENGINE A SPECIFIC THING AND WE WILL FIND US WITH ABSOLUTELY USELESS AND UNUSABLE INFORMATION ...

  3. but the problem is not the problem it is the cache ... if I am not mistaken in the versions before 2020 there was the possibility of preventing google from creating a cache page by providing the previous version, which is annoying and useless for those who write why changing a page means deleting it so that it cannot be read. This is a disgusting and bogus habit of the most useless search engine in the world, ie google to go dig in the trash ... we can not find the procedure to block the creation of cache pages by google .. always this option? otherwise, it doesn't make sense to deactivate a page from the search engine if the cache is then exhausted… and the thing is ludicrous ..

    1. Hello,

      Generally, you can do this in the settings of your SEO plugin. These allow you to do it directly on the editor or everything below.

  4. Hi Blair, I followed the steps you gave, but the Yoast plugin tells me the following: Warning: Even though you can set the meta-bots parameter here, the site is not indexed in site privacy settings. no effect.

    So when I check that my page is in the index, what can I do?

Leave a comment

Your email address will not be published. Required fields are marked with *

This site uses Akismet to reduce unwanted. Learn more about how your comments data is used.

Back To Top
18 shares
Share14
tweet1
Save3