{"id":751,"date":"2019-11-14T04:17:19","date_gmt":"2019-11-14T04:17:19","guid":{"rendered":"http:\/\/blog.hostinger.io\/hostinger-tutorials\/uncategorized\/prevent-search-egnines-from-indexing-wordpress\/"},"modified":"2026-03-10T09:36:56","modified_gmt":"2026-03-10T09:36:56","slug":"prevent-search-engines-from-indexing-wordpress","status":"publish","type":"post","link":"\/ph\/tutorials\/prevent-search-engines-from-indexing-wordpress","title":{"rendered":"How to discourage search engines from indexing this site in WordPress"},"content":{"rendered":"<p>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&rsquo;s still in development. In a case like this, it&rsquo;s recommended to discourage search engines from indexing your site. Stick with us if you want to learn more about this topic!<\/p><p class=\"has-text-align-center\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Mega-WordPress-Cheat-EN.pdf\" target=\"_blank\" rel=\"noopener\">Download all in one WordPress cheat sheet<\/a><\/p><p>\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-why-would-you-want-to-stop-search-engines-from-indexing-your-site\">Why Would You Want to Stop Search Engines From Indexing Your Site?<\/h2><p>There are some cases where people want to discourage search engines from indexing their sites:<\/p><ul class=\"wp-block-list\">\n<li><strong>Unfinished websites<\/strong> &mdash; at this stage of errors and trials, it&rsquo;s best not to have your website available to the public eyes. We recommend using a <a href=\"\/ph\/tutorials\/wordpress-staging-environment\">WordPress staging environment<\/a> when performing tests on your site.<\/li>\n\n\n\n<li><strong>Restricted websites <\/strong>&mdash; if you plan to have an invite-only website, you do not want it to get listed on SERPs.<\/li>\n\n\n\n<li><strong>Test accounts <\/strong>&mdash; web owners create a site duplicate for testing and trial purposes. Since these sites are not designed for the public, don&rsquo;t let it get indexed by search engines.<\/li>\n<\/ul><p>So how do you block search engines from indexing your site? Well, take a look at several options below and try it yourself.<\/p><h2 class=\"wp-block-heading\" id=\"h-1-discouraging-search-engines-from-indexing-wordpress-sites\">1. Discouraging Search Engines From Indexing WordPress Sites<\/h2><p>The simplest way to stop search engines from indexing your website is by preventing them from <a href=\"https:\/\/www.google.com\/search\/howsearchworks\/crawling-indexing\/\" target=\"_blank\" rel=\"noopener\">crawling it<\/a>. To do it, you need to edit your <a href=\"\/ph\/tutorials\/wordpress-robots-txt\">WordPress website&rsquo;s <strong>robots.txt<\/strong> file<\/a>. Here are a few ways to achieve that:<\/p><h3 class=\"wp-block-heading\" id=\"h-using-the-wordpress-built-in-feature\">Using the WordPress Built-In Feature<\/h3><p>Editing WordPress robots.txt is quite easy as you only need to use a WordPress built-in feature. Here&rsquo;s how:<\/p><ol class=\"wp-block-list\">\n<li>Login to the WordPress admin area and go to <strong>Settings<\/strong> <strong>&rarr;<\/strong> <strong>Reading<\/strong>.<\/li>\n\n\n\n<li>Scroll down and locate<strong> the Search Engine Visibility <\/strong>option.<\/li>\n\n\n\n<li>Check the option that says <strong>Discourage search engines from indexing this site.<\/strong><img decoding=\"async\" width=\"784\" height=\"246\" class=\"aligncenter wp-image-22133 size-full\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2017\/01\/search-engine-visibility-option-on-wordpress.png\" alt=\"This image shows you how to enable the Discourage search engine from indexing this site option in WordPress\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/search-engine-visibility-option-on-wordpress.png 784w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/search-engine-visibility-option-on-wordpress-150x47.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/search-engine-visibility-option-on-wordpress-300x94.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/search-engine-visibility-option-on-wordpress-768x241.png 768w\" sizes=\"(max-width: 784px) 100vw, 784px\" \/><\/li>\n\n\n\n<li><strong>Save Changes, <\/strong>and that&rsquo;s it! WordPress will automatically edit its <strong>robots.txt<\/strong> file for you.<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-editing-robots-txt-file-manually\">Editing robots.txt File Manually<\/h3><p>If you prefer the manual option, you can use <strong>File Manager <\/strong>or an <a href=\"\/ph\/tutorials\/what-is-ftp\">FTP client<\/a> to edit the <strong>robots.txt<\/strong> file.<\/p><p>In this article, we&rsquo;ll show you how to do it through the hPanel&rsquo;s File Manager:<\/p><ol class=\"wp-block-list\">\n<li>Login to hPanel and locate <strong>File Manager <\/strong>in your dashboard.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"627\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/hpanel-dashboard-filemanager-highlighted-1024x627.png\" alt=\"hPanel dashboard, File manager highlighted\" class=\"wp-image-83743\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/04\/hpanel-dashboard-filemanager-highlighted.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/04\/hpanel-dashboard-filemanager-highlighted-300x184.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/04\/hpanel-dashboard-filemanager-highlighted-150x92.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/04\/hpanel-dashboard-filemanager-highlighted-768x470.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div><ol class=\"wp-block-list\">\n<li>Go to your WordPress root directory folder (in most cases, <strong>it&rsquo;s public_html)<\/strong> and find the <strong>robots.txt<\/strong> file. If you can&rsquo;t find it, create a new blank file.<\/li>\n\n\n\n<li>Right-click on the file and select <strong>Edit<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/filemanager-publichtml-robotstxt-edit.png\"><img decoding=\"async\" width=\"1024\" height=\"730\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/filemanager-publichtml-robotstxt-edit-1024x730.png\" alt=\"Robots.txt file in the public.html in File Manager\" class=\"wp-image-79482\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/filemanager-publichtml-robotstxt-edit.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/filemanager-publichtml-robotstxt-edit-300x214.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/filemanager-publichtml-robotstxt-edit-150x107.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/03\/filemanager-publichtml-robotstxt-edit-768x548.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>Enter the following syntax:\n<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">User-agent:     *\nDisallow: \/<\/pre><p>The code above will prevent search engines from indexing <strong>your whole site<\/strong>. If you want to <a href=\"\/ph\/tutorials\/website\/how-to-block-search-engines-using-robotstxt\">apply the disallow rule to a specific page<\/a>, write the page&rsquo;s subdirectory and slug. For example: <strong>Disallow \/blog\/food-review-2019.<\/strong><\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Pro Tip<\/h4>\n                    <p> The syntaxes in <strong>robots.txt<\/strong> files are case sensitive, so be careful when editing.<\/p>\n                <\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-2-password-protecting-your-wordpress-website\">2. Password Protecting Your WordPress Website<\/h2><p>Search engines and web crawlers don&rsquo;t have access to password-protected files. Here are a few methods to password protect your WordPress site:<\/p><h3 class=\"wp-block-heading\" id=\"h-using-hosting-control-panel\">Using Hosting Control Panel<\/h3><p>If you are a Hostinger client, you can password protect your website using hPanel&rsquo;s <strong>Password Protect Directories<\/strong> tool:<\/p><ol class=\"wp-block-list\">\n<li>Access hPanel and navigate to <strong>Password Protect Directories<\/strong>.<\/li>\n\n\n\n<li>Enter your root directory into the first field.<\/li>\n\n\n\n<li>Once the directory is selected, enter your username and password and click <strong>Protect<\/strong>.<a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/11\/password-protect-directories.png\"><img decoding=\"async\" class=\"size-full wp-image-39205 aligncenter\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/11\/password-protect-directories.png\" alt=\"Password Protect Directories on hPanel.\" width=\"861\" height=\"341\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/11\/password-protect-directories.png 861w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/11\/password-protect-directories-300x119.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/11\/password-protect-directories-150x59.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/11\/password-protect-directories-768x304.png 768w\" sizes=\"(max-width: 861px) 100vw, 861px\" \/><\/a><\/li>\n<\/ol><p><div class=\"protip\">\n                    <h4 class=\"title\">Pro Tip<\/h4>\n                    <p>If your root directory is <strong>public_html<\/strong>, leave the directory column blank.<\/p>\n                <\/div>\n\n\n\n<\/p><p>The process in cPanel is also quite similar:<\/p><ol class=\"wp-block-list\">\n<li>Log in to your cPanel account and head to <strong>Directory Privacy<\/strong>.<img decoding=\"async\" width=\"944\" height=\"297\" class=\"aligncenter wp-image-22254 size-full\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2017\/01\/directory-privacy-tool-on-cpanel.png\" alt=\"This image shows you the Directory Privacy tool in cPanel.\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/directory-privacy-tool-on-cpanel.png 944w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/directory-privacy-tool-on-cpanel-150x47.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/directory-privacy-tool-on-cpanel-300x94.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/directory-privacy-tool-on-cpanel-768x242.png 768w\" sizes=\"(max-width: 944px) 100vw, 944px\" \/><\/li>\n\n\n\n<li>Select your root directory. In our case, it&rsquo;s<strong>&nbsp;public_html<\/strong>.<\/li>\n\n\n\n<li>Check the <strong>Password protect this directory<\/strong> option, and name the protected directory. Press <strong>Save<\/strong>.<img decoding=\"async\" width=\"1348\" height=\"472\" class=\"aligncenter wp-image-22255 size-full\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2017\/01\/directory-privacys-password-protecting-feature-on-hpanel.png\" alt=\"This image shows you how to use cPanel's Directory Privacy feature\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/directory-privacys-password-protecting-feature-on-hpanel.png 1348w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/directory-privacys-password-protecting-feature-on-hpanel-150x53.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/directory-privacys-password-protecting-feature-on-hpanel-300x105.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/directory-privacys-password-protecting-feature-on-hpanel-768x269.png 768w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/directory-privacys-password-protecting-feature-on-hpanel-1024x359.png 1024w\" sizes=\"(max-width: 1348px) 100vw, 1348px\" \/><\/li>\n\n\n\n<li>Create a new user to log in to the protected website, and that&rsquo;s it!<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-using-wordpress-plugins\">Using WordPress Plugins<\/h3><p>There are tons of plugins that can help password protect your site. However, the <a href=\"https:\/\/wordpress.org\/plugins\/password-protected\/\" target=\"_blank\" rel=\"noopener\"><strong>Password Protected<\/strong><\/a> plugin might just be the best one out there. It&rsquo;s been tested with the new WordPress update, and it&rsquo;s pretty straightforward to use.<\/p><p>After <a href=\"\/ph\/tutorials\/wordpress\/how-to-install-wordpress-plugins\">installing the plugin<\/a> and activating it, head to <strong>Settings &rarr; Password Protected <\/strong>and configure the settings to match your needs.<\/p><h2 class=\"wp-block-heading\" id=\"h-3-removing-indexed-page-from-google\">3. Removing Indexed Page From Google<\/h2><p>Don&rsquo;t worry if Google has indexed your site. You can remove it from SERPs by following these steps:<\/p><ol class=\"wp-block-list\">\n<li>Set up Google Search Console for your website.<\/li>\n\n\n\n<li>Access Google Search Console of your newly added website and scroll down to <strong>Legacy tools and reports &rarr; Removals.<\/strong><\/li>\n\n\n\n<li>Click the <strong>Temporarily hide button<\/strong> and enter the URL you want to remove from Google.<\/li>\n\n\n\n<li>On a new window, choose <b>Clear URL from cache and temporarily remove from search, <\/b>then <strong>Submit Request<\/strong>.<img decoding=\"async\" width=\"727\" height=\"261\" class=\"aligncenter size-full wp-image-22258\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2017\/01\/google-search-console-submit-removal-request.png\" alt=\"This image shows you the Google Search Console Submit Removal Request\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/google-search-console-submit-removal-request.png 727w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/google-search-console-submit-removal-request-150x54.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2017\/01\/google-search-console-submit-removal-request-300x108.png 300w\" sizes=\"(max-width: 727px) 100vw, 727px\" \/><\/li>\n<\/ol><p>And that&rsquo;s it! Google will temporarily remove your site from search results. Make sure to apply the previous methods to prevent Google from indexing your site again.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>There you have it! Quick and easy ways to discourage search engines from indexing your sites. Here&rsquo;s a quick recap of the methods we&rsquo;ve learned today:<\/p><ul class=\"wp-block-list\">\n<li>Edit the <strong>robots.txt<\/strong> file, which can be performed automatically or manually.<\/li>\n\n\n\n<li>Password protect your website by using a plugin or your hosting control panel.<\/li>\n\n\n\n<li>Remove indexed pages from Google via Google Search console.<\/li>\n<\/ul><p>If you have any other methods, or if you have any questions, please do let us know in the comments. Good luck!<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Learn More About WordPress SEO<\/h4>\n                    <p> <a href=\"\/ph\/tutorials\/wordpress-seo-tips\">WordPress SEO Tips<\/a><br>\n<a href=\"\/ph\/tutorials\/how-to-create-wordpress-sitemap\">How to Create a Sitemap in WordPress<\/a><br>\n<a href=\"\/ph\/tutorials\/wordpress-schema-markup\/\">How to Add WordPress Schema Markup<\/a><br>\n<a href=\"\/ph\/tutorials\/wordpress-meta-description\">How to Add Meta Description and Meta Title in WordPress<\/a><br>\n<a href=\"\/ph\/tutorials\/wordpress-amp\/\">How to Setup AMP (Accelerated Mobile Pages) in WordPress<\/a><br>\n<a href=\"\/ph\/tutorials\/add-breadcrumbs-wordpress\">How to Add Breadcrumbs in WordPress<\/a> <\/p>\n                <\/div>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&rsquo;s still in development. In a case like this, it&rsquo;s recommended to discourage search engines from indexing your site. Stick with us if you want to learn more about this topic! [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ph\/tutorials\/prevent-search-engines-from-indexing-wordpress\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Discourage Search Engines from Indexing Your Site","rank_math_description":"In some cases, you don't want your site to appear in SERPs. Learn the different ways to discourage search engines from indexing your site.","rank_math_focus_keyword":"discourage search engines from indexing this site","footnotes":""},"categories":[22632],"tags":[],"class_list":["post-751","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/prevent-search-engines-from-indexing-wordpress","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/como-evitar-motores-de-busca-de-indexacao-blog","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/desactiver-indexation-wordpress","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/remover-sitio-de-google","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-mencegah-mesin-pencari-mengindex-blog-wordpress","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/prevent-search-engines-from-indexing-wordpress","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/prevent-search-engines-from-indexing-wordpress","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/prevent-search-engines-from-indexing-wordpress","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/remover-sitio-de-google","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/remover-sitio-de-google","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/remover-sitio-de-google","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/como-evitar-motores-de-busca-de-indexacao-blog","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/prevent-search-engines-from-indexing-wordpress","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/prevent-search-engines-from-indexing-wordpress","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/prevent-search-engines-from-indexing-wordpress","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/prevent-search-engines-from-indexing-wordpress","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/751","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/comments?post=751"}],"version-history":[{"count":24,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/751\/revisions"}],"predecessor-version":[{"id":127748,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/751\/revisions\/127748"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/media?parent=751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/categories?post=751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/tags?post=751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}