Search engine visibility wordpress

New Page

Best Ways to Hide a WordPress Page from Google

Anna Fitzgerald

Anna Fitzgerald

Posted: August 03, 2022

Why hide a WordPress page from Google or other search engines? With 61% of marketers saying improving SEO and increasing organic presence are their top priorities, it seems counterintuitive to hide content from potential customers.

developer hiding a wordpress page from google

However, there are several reasons to hide content from search results. If you have an invite-only event, for example, you don’t want visitors to find the page with the RSVP link in a SERP. Or you may have pages with sales presentations or team communications that are for internal use only.

Whatever the reason, you have several options for hiding a WordPress page from Google. In this article, we’ll show you how.

Grow your business with HubSpot’s tools for WordPress websites


  • How to Hide a WordPress Page from Google
  • Using the Robots.txt file to hide WordPress pages from Google
  • Using Yoast SEO to Hide WordPress Pages from Google

  • Change WordPress Page Visibility

  • Take control of your WordPress content

How to Hide a WordPress Page from Google

There are two options for hiding a WordPress page from Google. You can edit the robots.txt file in your hosting account’s control panel. However, since an error in this file can negatively affect your site’s SEO, this method is recommended for more advanced users. Newbie users who lack coding experience can use the Yoast SEO plugin to tell Google not to index certain pages on their site.

We’ll discuss each of these methods in detail below so you can choose the one that best suits your level of technical expertise.

Using the Robots.txt file to hide WordPress pages from Google

Pour cacher certaines pages à Google, vous pouvez éditer le fichier robots.txt dans le panneau de contrôle de votre compte d’hébergement. Robots.txt est un fichier situé dans le répertoire racine de votre site qui indique à Google et aux autres robots des moteurs de recherche les publications et les pages à explorer.

Pour y accéder, connectez-vous au cPanel de votre compte d’hébergement et cliquez sur l’icône Gestionnaire de fichiers dans la section Fichiers.

File manager icon in the Files section of the hosting account's cPanel

Police de caractère

Dans le menu de navigation sur le côté gauche de votre écran, cliquez sur le dossier public_html. Localisez le fichier robots.txt et cliquez sur Modifier dans le menu en haut de l’écran.

Ubique el archivo robots.txt en su carpeta public_html y haga clic en Editar en el menú en la parte superior de su pantalla

Police de caractère

Il s’ouvrira dans un éditeur de texte tel que le Bloc-notes sous Windows ou TextEdit sur Mac. Supprimez tout texte existant et copiez-collez le code suivant :

User-agent: * Disallow: /your-page/

Note that you will need to replace the placeholder text in the Disallow field with the URL path of the page you want to hide. The path is right after your domain name.

For example, suppose the URL of the page you want to hide is

Then the code snippet you add to your robots.txt file will look like this:

User-agent: * Ban: /2020/1/pricing-page/

Vous pouvez laisser le champ User-agent tel quel, car l’astérisque signifie que tous les robots d’exploration Web seront invités à ne pas indexer cette page. Si vous souhaitez masquer cette page à Google uniquement, remplacez l’astérisque par “Googlebot” dans le champ user-agent. Cela permettra aux autres robots des moteurs de recherche d’indexer la page.

Une fois que vous avez apporté vos modifications à l’extrait de code, enregistrez et téléchargez le fichier robots.txt dans votre dossier public_html.

cargue el archivo robots.txt nuevamente en su carpeta public_html en el cPanel de su cuenta de hosting

La source

Google search crawlers will now follow the instructions in this file and not index this page.

While this method is relatively simple for users with some coding knowledge, it may not be for beginners. That’s because any incorrect information added to a robots.txt file will harm your site’s search engine visibility. For that reason, if you don’t have coding skills, you may be better off using a plugin.

Using Yoast SEO to Hide WordPress Pages From Google

If you’d like to avoid coding altogether, you can use the Yoast SEO plugin to hide pages from Google. To start, install and activate the plugin on your WordPress site.

Once it’s been successfully installed and activated, navigate to Pages > All Pages in your WordPress dashboard to edit the page you would like to hide from Google.

Scroll down to the Yoast SEO meta box below the post editor. Along the left side of this window, click on the gear icon to open the plugin’s advanced settings.

el cuadro meta de Yoast SEO está debajo del editor de publicaciones


Here you can add meta tag robots to tell search engines like Google not to index or follow the page.

Just select Noindex from the drop-down menu under “Meta robots index.” Then click Nofollow under “Meta robots follow.”

seleccione Noindex en el menú desplegable en "Índice de meta robots" en la configuración del complemento Yoast SEO


You can now save or publish the post. Yoast SEO will add a line of code to the page that looks something like:

<meta name=”robots” content=”noindex,nofollow”/>

Search engines will now be instructed not to follow or index this page. If you’d like to hide this page from Google only, and not all search engines, then replace “robots” with “Googlebot.”

Changing the Visibility of WordPress Pages

While the above methods will prevent certain pages from appearing in Google search results, any visitors who have (or can guess) the link will still be able to view this content. If you’d like to hide this content from visitors, then you can set up a password to protect it.

There’s no need to install a plugin. WordPress comes with a built-in password protection feature for pages and posts. You just need to navigate to the page that you want to protect and go to the Publish meta box. Then click the link labeled “Edit” next to the Visibility option.

haga clic en el enlace "Editar" junto a la opción Visibilidad en el cuadro meta de publicación

Select the “Password protected” option and fill in your password in the empty input box.

Seleccione la opción "Protegido con contraseña" y complete su contraseña en el cuadro de entrada vacío

Once you click the Publish button, only users who know the password will be able to view the page.

Taking Control of Your WordPress Content

Using either of the methods above will enable you to hide a WordPress page from Google search results. Controlling which pages are visible in search and which are hidden will help ensure you put the right content in front of the right people.

Use las herramientas de HubSpot en su sitio web de WordPress y conecte las dos plataformas sin tener que lidiar con el código. Clic aquí para saber más.

Topics: WordPress Website

¡No olvides compartir esta publicación!

WordPress Advanced

Aug 24, 2022

Domantas G.

3min Read

How to Discourage Search Engines from Indexing this Site in WordPress (Easy Way)

Copy link


Cómo disuadir a los motores de búsqueda de indexar este sitio en WordPress (manera fácil) How to Discourage Search Engines from Indexing this Site in WordPress (Easy Way)

WordPress site owners will do anything to get their websites indexed. However, you might not want search engines to crawl through your website if it’s still in development. In a case like this, it’s recommended to discourage search engines from indexing your site. Stick with us if you want to learn more about this topic!

Download Ultimate WordPress Cheat Sheet

  • Why Would You Want to Stop Search Engines From Indexing Your Site?
  • 1. Discouraging Search Engines From Indexing WordPress Sites
    • Using the WordPress Built-In Feature
    • Editing robots.txt File Manually
  • 2. Password Protecting Your WordPress Website
    • Using Hosting Control Panel
    • Using WordPress Plugins
  • 3. Removing Indexed Page From Google

Why Would You Want to Stop Search Engines From Indexing Your Site?

There are some cases where people want to discourage search engines from indexing their sites:

  • Unfinished websites — at this stage of errors and trials, it’s best not to have your website available to the public eyes. We recommend using a WordPress staging environment when performing tests on your site.
  • Restricted websites — if you plan to have an invite-only website, you do not want it to get listed on SERPs.
  • Test accounts — web owners create a site duplicate for testing and trial purposes. Since these sites are not designed for the public, don’t let it get indexed by search engines.

So how do you block search engines from indexing your site? Well, take a look at several options below and try it yourself.

1. Discouraging Search Engines From Indexing WordPress Sites

The simplest way to stop search engines from indexing your website is by preventing them from crawling it. To do it, you need to edit your WordPress website’s robots.txt file. Here are a few ways to achieve that:

Using the WordPress Built-In Feature

Editing WordPress robots.txt is quite easy as you only need to use a WordPress built-in feature. Here’s how:

  1. Login to the WordPress admin area and go to Settings -> Reading.
  2. Scroll down and locate the Search Engine Visibility option.
  3. Check the option that says Discourage search engines from indexing this site.Esta imagen muestra cómo habilitar la opción Disuadir al motor de búsqueda de indexar este sitio en WordPress This image shows you how to enable the Discourage search engine from indexing this site option in WordPress
  4. Save Changes, and that’s it! WordPress will automatically edit its robots.txt file for you.

Editing robots.txt File Manually

If you prefer the manual option, you can use File Manager or an FTP client to edit the robots.txt file.

In this article, we’ll show you how to do it through the hPanel’s File Manager:

  1. Login to hPanel and locate File Manager under the Files area.

Administrador de archivos en hPanel. File Manager on hPanel.

  1. Go to your WordPress root directory folder (in most cases, it’s public_html) and find the robots.txt file. If you can’t find it, create a new blank file.
  2. Right-click on the file and select Edit.Esta imagen muestra cómo editar el archivo robots.txt en el Administrador de archivos de hPanel This image shows you how to edit robots.txt file in hPanel's File Manager
  3. Enter the following syntax: User-agent: * Disallow: /

The code above will prevent search engines from indexing your whole site. If you want to apply the disallow rule to a specific page, write the page’s subdirectory and slug. For example: Disallow /blog/food-review-2019.

Pro Tip

The syntaxes in robots.txt files are case sensitive, so be careful when editing.

2. Password Protecting Your WordPress Website

Search engines and web crawlers don’t have access to password-protected files. Here are a few methods to password protect your WordPress site:

Using Hosting Control Panel

If you are a Hostinger client, you can password protect your website using hPanel’s Password Protect Directories tool:

  1. Access hPanel and navigate to Password Protect Directories.
  2. Enter your root directory into the first field.
  3. Once the directory is selected, enter your username and password and click Protect.Directorios protegidos con contraseña en hPanel. Password Protect Directories on hPanel.

Pro Tip

If your root directory is public_html, leave the directory column blank.

The process in cPanel is also quite similar:

  1. Log in to your cPanel account and head to Directory Privacy.Esta imagen le muestra la herramienta de privacidad de directorios en cPanel. This image shows you the Directory Privacy tool in cPanel.
  2. Select your root directory. In our case, it’s public_html.
  3. Check the Password protect this directory option, and name the protected directory. Press Save.This image shows you how to use cPanel's directory privacy feature This image shows you how to use cPanel's directory privacy feature
  4. Create a new user to log in to the protected website, and that’s it!

Using WordPress Plugins

There are tons of plugins that can help password protect your site. However, the Password Protected plugin might just be the best one out there. It’s been tested with the new WordPress update, and it’s pretty straightforward to use.

After installing the plugin and activating it, head to Settings -> Password Protected and configure the settings to match your needs.

3. Removing Indexed Page From Google

Don’t worry if Google has indexed your site. You can remove it from the SERPs by following these steps:

  1. Configure Google Search Console for your website.
  2. Go to Google Search Console of your newly added website and scroll down to Legacy Tools & Reports -> Deletions.
  3. Click the Temporarily hide button and enter the URL you want to remove from Google.
  4. In a new window, choose Clear URL from cache and temporarily remove from search, then Submit request .This image shows Google Search Console submission removal request This image shows you the Google Search Console Submit a removal request

And that’s it! Google will temporarily remove your site from search results. Make sure to apply the above methods to prevent Google from re-indexing your site.


Here! Quick and easy ways to discourage search engines from indexing your sites. Here is a quick overview of the methods we learned today:

  • Edit the robots.txt file , which can be done automatically or manually.
  • Password protect your website using a plugin or your hosting control panel.
  • Delete Google indexed pages via Google Search Console.

If you have other methods, or have any questions, let us know in the comments. Good luck!

Learn more about WordPress SEO

WordPress SEO Tips How to Create a WordPress Sitemap How to Add WordPress Schema Markup How to Add Meta Description and Meta Title in WordPress How to Set Up AMP (Accelerated Mobile Pages) in WordPress How to Add Breadcrumbs in WordPress

Was this tutorial helpful to you?



Author Author

The author

Domantas G.

Domantas leads content and SEO teams with fresh ideas and fresh approaches. Armed with in-depth SEO and marketing knowledge, he aims to bring Hostinger to every corner of the world. In his spare time, Domantas enjoys honing his web development skills and traveling to exotic locations.

More Domantas G.

Allow Search Engine Indexing in WordPress

To help improve SEO rankings, follow these steps to ensure your WordPress site allows search engine indexing.

  1. Login to WordPress.
  2. Click Settings > Playback .
  3. Make sure Discourage search engines from indexing this site is not selected.

More information

  • Improve Google indexing.
  • If you need help with search engine indexing, our WP Premium Support Catalog can do it for you.

Video Search engine visibility wordpress

Related Posts

Free chat room code for my website

Contents1 How to set up a free chat room on the website.2 3 comentarios2.1 Trackbacks/Pingbacks2.2 Submit a Comment Cancel reply3 How to Create a Chat Room Website…

Background image full screen css

Contents1 Cómo – Full Page Image1.1 Example1.2 Example2 CSS background image tamaño tutorial: how to codify a complete page background image3 Perfect Full Page Background Image3.1 Méthode CSS géniale,…

WordPress leverage browser caching

Contents1 Aproveche el almacenamiento in hidden del navegador1.1 Will it works for my website?1.2 Where are plugin options1.3 Some JavaScript files still display under Leverage Browser Caching1.4…

WordPress post to facebook page

Contents1 How to Automatically Post to Facebook from WordPress1.1 Download Now: How to Launch a WordPress Website [Free Guide + Checklist]1.2 1. Create an IFTTT account.1.3 2….

Download images from wordpress media library

Contents1 How to export your WordPress media library1.1 Download maintenant : How to launch a WordPress website [Free Guide + Checklist]1.2 How to export your WordPress media…

WordPress single post template

Contents1 How to Create Custom Unique Post Templates in WordPress2 Post Template Files2.1 author.php2.2 Fecha.php3 Handbook navigation4 How to Create Custom Single Post Templates in WordPress5 Video…