If you want to hide your WordPress site from search engines, you can use the “Discourage search engines from indexing this site” option in the “Reading Settings” page of your WordPress dashboard.
To access this option, follow these steps:
- Log in to your WordPress dashboard.
- Go to the “Settings” menu and click on “Reading”.
- Scroll down to the “Search Engine Visibility” section.
- Check the box next to “Discourage search engines from indexing this site”.
- Click the “Save Changes” button.

This will add a “noindex” directive to your site’s pages, which tells search engines not to index your site. Keep in mind that it may take some time for search engines to stop indexing your site, as they will need to recrawl your pages and discover the “noindex” directive.
If you want to hide your site from search engines only temporarily, you can uncheck the box at any time to allow search engines to index your site again.
In addition to using the “Discourage search engines from indexing this site” option in the “Reading Settings” page, there are a few other ways you can hide your WordPress site from search engines:
- Add a “noindex” directive to your site’s robots.txt file. This file is located in the root directory of your site and can be used to instruct search engines which pages or directories they should not crawl.
- Use the “X-Robots-Tag” HTTP header to add a “noindex” directive to your site’s pages. This can be done using a plugin or by adding a custom code snippet to your site’s .htaccess file.
- Password protect website directory so that Google can’t access it.
Edit robots.txt file
To add a “noindex” directive to your site’s robots.txt file, follow these steps:
- Log in to your site using an FTP client or the file manager in your hosting control panel.
- Navigate to the root directory of your site.
- Locate the robots.txt file and open it in a text editor.
- Add a line containing the “noindex” directive to the file. For example:
User-agent: *
Disallow:
Noindex: /
- Save the robots.txt file and upload it back to the root directory of your site.
This will add a “noindex” directive to all pages on your site, instructing search engines not to index them.
Add “X-Robots-Tag” HTTP header
To add a “noindex” directive to your site’s pages using the “X-Robots-Tag” HTTP header, you can use a plugin or add a custom code snippet to your site’s .htaccess file.
To use a plugin:
- Install and activate the “HTTP Headers” plugin.
- Go to the “Settings” menu and click on “HTTP Headers”.
- Scroll down to the “X-Robots-Tag” section.
- Check the box next to “noindex”.
- Click the “Save Changes” button.
This will add a “noindex” directive to all pages on your site, instructing search engines not to index them.
To add a custom code snippet:
- Log in to your site using an FTP client or the file manager in your hosting control panel.
- Navigate to the root directory of your site.
- Locate the .htaccess file and open it in a text editor.
- Add the following code snippet to the file:
<IfModule mod_headers.c>
Header set X-Robots-Tag "noindex"
</IfModule>
- Save the .htaccess file and upload it back to the root directory of your site.
This will add a “noindex” directive to all pages on your site, instructing search engines not to index them.
Password protect directory
- Log in to your site using an FTP client or the file manager in your hosting control panel.
- Navigate to the root directory of your site.
- Locate the .htaccess file and open it in a text editor.
- Add the following code snippet to the file:
AuthType Basic
AuthName "Protected Area"
AuthUserFile /path/to/.htpasswd
Require valid-user
- Save the .htaccess file and upload it back to the root directory of your site.
This will add password protection to your entire site, and will prevent search engines from indexing it.
Here is an example of what a .htpasswd file might look like:
username:$apr1$jKL6pYT0$RVJT0TBIlhV3HsQ2c0V7J1
In this example, “username” is the username for the protected area, and the string of characters after the colon (“:”) is an encrypted password.
To create a .htpasswd file for your own site, you can use a tool like the “htpasswd” utility or an online generator. Here’s how you might use the “htpasswd” utility:
- Open a terminal or command prompt.
- Navigate to the directory where you want to create the .htpasswd file.
- Run the following command:
htpasswd -c .htpasswd username
- Enter a password when prompted, and confirm it by entering it again.
This will create a new .htpasswd file in the current directory, with the specified username and password.
Keep in mind that password protecting your site can make it difficult for users to access your content, so it’s generally a good idea to use this method only if you have a specific reason for wanting to hide your site from search engines.
Keep in mind that hiding your site from search engines can make it harder for people to find your site through search, so it’s generally a good idea to only use these methods if you have a specific reason for wanting to hide your site from search engines.
Was this post helpful?
Let me know if you liked the post. That’s the only way I can improve. :)


This article provides a useful guide for website owners who want to temporarily hide their website from search engines. The step-by-step instructions are easy to follow and require no technical expertise.