{"id":2715,"date":"2018-08-23T09:37:19","date_gmt":"2018-08-23T09:37:19","guid":{"rendered":"https:\/\/www.searchviu.com\/?p=2715"},"modified":"2023-02-09T13:58:07","modified_gmt":"2023-02-09T13:58:07","slug":"robots-txt-staging-environment","status":"publish","type":"post","link":"https:\/\/www.searchviu.com\/en\/robots-txt-staging-environment\/","title":{"rendered":"Why you shouldn&#8217;t block your entire staging environment via robots.txt"},"content":{"rendered":"<p><strong>It&#8217;s a common practice to block entire staging environments via robots.txt &#8211; We see roughly 50% of our website migration clients do it. Here&#8217;s why it&#8217;s not a good idea.<\/strong><\/p>\n<p>Webmasters, when preparing a website migration, often decide to add a robots.txt file with the following content to the staging environment of the new website:<\/p>\n<p><code>User-agent: *<br \/>\nDisallow: \/<\/code><\/p>\n<p>These instructions ask robots to stay away from all pages on the site. The idea behind such an implementation is to prevent the content of the staging environment from being indexed by search engines.<\/p>\n<h2>Use the &#8220;real&#8221; robots.txt file<\/h2>\n<p>The short and simple robots.txt file we saw above obviously isn&#8217;t the one that will be needed once the new website goes live. The &#8220;real&#8221; robots.txt will be a bit more complex. It&#8217;s a good idea to add this final robots.txt to the staging environment already, for the following reasons:<\/p>\n<ul>\n<li>First, you can already simulate real crawling behaviour on the staging environment with a crawler that respects the robots.txt file, and without custom robots.txt settings. This way you can check, for instance, if all pages are linked correctly internally, even when blocked pages are not crawled, or if crawl resources are wasted on pages that should be blocked via the robots.txt file, but aren&#8217;t yet.<\/li>\n<li>Second, by using the &#8220;real&#8221; robots.txt file on the staging environment, you eliminate the risk of going live with a robots.txt file that blocks your entire site. Most SEOs have probably heard of <a href=\"https:\/\/twitter.com\/search?f=tweets&amp;q=%23seohorrorstories%20robots.txt%20disallow&amp;src=typd\" rel=\"noopener noreferrer\" target=\"_blank\">several cases<\/a> where this happened and caused a lot of pain.<\/li>\n<\/ul>\n<h2>Don&#8217;t use &#8220;noindex&#8221; for all staging pages either<\/h2>\n<p>A very similar (but less common) habit is setting all pages on the staging environment to &#8220;noindex&#8221;. Again, the idea is to prevent them from being indexed, but the problems are the same as the ones described above:<\/p>\n<p>You want to be able to check which pages are correctly set to &#8220;noindex&#8221; before the website goes live, or which pages need to be set to &#8220;noindex&#8221;, but aren&#8217;t yet. And you definitely don&#8217;t want your new website to go live with all pages set to &#8220;noindex&#8221;.<\/p>\n<p>Just like blocking all pages on your staging environment via robots.txt, setting them all to &#8220;noindex&#8221; is also a bad idea.<\/p>\n<h2>How to properly protect your staging environment<\/h2>\n<p>It is of course of utter importance to make sure your staging environment doesn&#8217;t get indexed by search engines, but blocking all pages via robots.txt or setting all pages to &#8220;noindex&#8221; are not the right way to go. Staging environments should be protected with an HTTP username and password, or the access should be limited to certain IP addresses.<\/p>\n<p>In both cases, the crawlers you use for your pre-migration analysis can still access the staging environment, if configured correctly. Almost all crawling tools can log into an HTTP username and password protected staging environment, and most of them can also crawl your staging environment using a static IP that you can whitelist.<\/p>\n<p>By using the robots.txt and &#8220;noindex&#8221; settings that you will need when the page goes live, you can make sure to simulate real crawling behaviour on the staging environment. Another advantage of the methods recommended here is that they are a lot more secure &#8211; robots.txt and &#8220;noindex&#8221; instructions can always be ignored by crawlers, while HTTP authentication and IP restriction definitely keep them out.<\/p>\n<h2>What are your thoughts and experiences?<\/h2>\n<p>What do you think about blocking entire staging environments via robots.txt files? We&#8217;d love to hear your opinion in the comments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s a common practice to block entire staging environments via robot.txt &#8211; Learn about better ways to make sure your staging website doesn&#8217;t get indexed.<\/p>\n","protected":false},"author":3,"featured_media":1086,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[7],"tags":[29],"class_list":["post-2715","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website-migration-seo","tag-engllish"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>robots.txt &amp; noindex for staging site: How to use them correctly<\/title>\n<meta name=\"description\" content=\"It&#039;s a common practice to block entire staging environments via robot.txt - Learn about better ways to make sure your staging website doesn&#039;t get indexed.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.searchviu.com\/en\/robots-txt-staging-environment\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"robots.txt &amp; noindex for staging site: How to use them correctly\" \/>\n<meta property=\"og:description\" content=\"It&#039;s a common practice to block entire staging environments via robot.txt - Learn about better ways to make sure your staging website doesn&#039;t get indexed.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.searchviu.com\/en\/robots-txt-staging-environment\/\" \/>\n<meta property=\"og:site_name\" content=\"SEO Data Warehouse And Monitoring\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-23T09:37:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-09T13:58:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.searchviu.com\/wp-content\/uploads\/2023\/02\/b890d662-robots-txt-staging-environment-400x269-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"269\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Eoghan Henn\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@searchviu\" \/>\n<meta name=\"twitter:site\" content=\"@searchviu\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Eoghan Henn\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/\"},\"author\":{\"name\":\"Eoghan Henn\",\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/#\\\/schema\\\/person\\\/7a031e5565b9ece3fd77be3c7f19381c\"},\"headline\":\"Why you shouldn&#8217;t block your entire staging environment via robots.txt\",\"datePublished\":\"2018-08-23T09:37:19+00:00\",\"dateModified\":\"2023-02-09T13:58:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/\"},\"wordCount\":617,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.searchviu.com\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/b890d662-robots-txt-staging-environment-400x269-1.jpg\",\"keywords\":[\"Engllish\"],\"articleSection\":[\"Website migration SEO\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/\",\"url\":\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/\",\"name\":\"robots.txt & noindex for staging site: How to use them correctly\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.searchviu.com\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/b890d662-robots-txt-staging-environment-400x269-1.jpg\",\"datePublished\":\"2018-08-23T09:37:19+00:00\",\"dateModified\":\"2023-02-09T13:58:07+00:00\",\"description\":\"It's a common practice to block entire staging environments via robot.txt - Learn about better ways to make sure your staging website doesn't get indexed.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.searchviu.com\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/b890d662-robots-txt-staging-environment-400x269-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.searchviu.com\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/b890d662-robots-txt-staging-environment-400x269-1.jpg\",\"width\":400,\"height\":269},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/robots-txt-staging-environment\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.searchviu.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Why you shouldn&#8217;t block your entire staging environment via robots.txt\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/#website\",\"url\":\"https:\\\/\\\/www.searchviu.com\\\/\",\"name\":\"SEO Data Warehouse And Monitoring\",\"description\":\"SEO Solutions For Teams And Agencies\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.searchviu.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/#organization\",\"name\":\"searchVIU\",\"url\":\"https:\\\/\\\/www.searchviu.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.searchviu.com\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/d3babe41-searchviu-logo2x.png\",\"contentUrl\":\"https:\\\/\\\/www.searchviu.com\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/d3babe41-searchviu-logo2x.png\",\"width\":340,\"height\":340,\"caption\":\"searchVIU\"},\"image\":{\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/searchviu\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/searchviu\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.searchviu.com\\\/#\\\/schema\\\/person\\\/7a031e5565b9ece3fd77be3c7f19381c\",\"name\":\"Eoghan Henn\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bfa3d44dac21ee6e663defdfe4eb2ecb29ad85001375745329c7526fa74b95b7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bfa3d44dac21ee6e663defdfe4eb2ecb29ad85001375745329c7526fa74b95b7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bfa3d44dac21ee6e663defdfe4eb2ecb29ad85001375745329c7526fa74b95b7?s=96&d=mm&r=g\",\"caption\":\"Eoghan Henn\"},\"url\":\"https:\\\/\\\/www.searchviu.com\\\/en\\\/author\\\/eoghan\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"robots.txt & noindex for staging site: How to use them correctly","description":"It's a common practice to block entire staging environments via robot.txt - Learn about better ways to make sure your staging website doesn't get indexed.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.searchviu.com\/en\/robots-txt-staging-environment\/","og_locale":"en_US","og_type":"article","og_title":"robots.txt & noindex for staging site: How to use them correctly","og_description":"It's a common practice to block entire staging environments via robot.txt - Learn about better ways to make sure your staging website doesn't get indexed.","og_url":"https:\/\/www.searchviu.com\/en\/robots-txt-staging-environment\/","og_site_name":"SEO Data Warehouse And Monitoring","article_published_time":"2018-08-23T09:37:19+00:00","article_modified_time":"2023-02-09T13:58:07+00:00","og_image":[{"width":400,"height":269,"url":"https:\/\/www.searchviu.com\/wp-content\/uploads\/2023\/02\/b890d662-robots-txt-staging-environment-400x269-1.jpg","type":"image\/jpeg"}],"author":"Eoghan Henn","twitter_card":"summary_large_image","twitter_creator":"@searchviu","twitter_site":"@searchviu","twitter_misc":{"Written by":"Eoghan Henn","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.searchviu.com\/robots-txt-staging-environment\/#article","isPartOf":{"@id":"https:\/\/www.searchviu.com\/robots-txt-staging-environment\/"},"author":{"name":"Eoghan Henn","@id":"https:\/\/www.searchviu.com\/#\/schema\/person\/7a031e5565b9ece3fd77be3c7f19381c"},"headline":"Why you shouldn&#8217;t block your entire staging environment via robots.txt","datePublished":"2018-08-23T09:37:19+00:00","dateModified":"2023-02-09T13:58:07+00:00","mainEntityOfPage":{"@id":"https:\/\/www.searchviu.com\/robots-txt-staging-environment\/"},"wordCount":617,"commentCount":5,"publisher":{"@id":"https:\/\/www.searchviu.com\/#organization"},"image":{"@id":"https:\/\/www.searchviu.com\/robots-txt-staging-environment\/#primaryimage"},"thumbnailUrl":"https:\/\/www.searchviu.com\/wp-content\/uploads\/2023\/02\/b890d662-robots-txt-staging-environment-400x269-1.jpg","keywords":["Engllish"],"articleSection":["Website migration SEO"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.searchviu.com\/robots-txt-staging-environment\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.searchviu.com\/robots-txt-staging-environment\/","url":"https:\/\/www.searchviu.com\/robots-txt-staging-environment\/","name":"robots.txt & noindex for staging site: How to use them correctly","isPartOf":{"@id":"https:\/\/www.searchviu.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.searchviu.com\/robots-txt-staging-environment\/#primaryimage"},"image":{"@id":"https:\/\/www.searchviu.com\/robots-txt-staging-environment\/#primaryimage"},"thumbnailUrl":"https:\/\/www.searchviu.com\/wp-content\/uploads\/2023\/02\/b890d662-robots-txt-staging-environment-400x269-1.jpg","datePublished":"2018-08-23T09:37:19+00:00","dateModified":"2023-02-09T13:58:07+00:00","description":"It's a common practice to block entire staging environments via robot.txt - Learn about better ways to make sure your staging website doesn't get indexed.","breadcrumb":{"@id":"https:\/\/www.searchviu.com\/robots-txt-staging-environment\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.searchviu.com\/robots-txt-staging-environment\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.searchviu.com\/robots-txt-staging-environment\/#primaryimage","url":"https:\/\/www.searchviu.com\/wp-content\/uploads\/2023\/02\/b890d662-robots-txt-staging-environment-400x269-1.jpg","contentUrl":"https:\/\/www.searchviu.com\/wp-content\/uploads\/2023\/02\/b890d662-robots-txt-staging-environment-400x269-1.jpg","width":400,"height":269},{"@type":"BreadcrumbList","@id":"https:\/\/www.searchviu.com\/robots-txt-staging-environment\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.searchviu.com\/en\/"},{"@type":"ListItem","position":2,"name":"Why you shouldn&#8217;t block your entire staging environment via robots.txt"}]},{"@type":"WebSite","@id":"https:\/\/www.searchviu.com\/#website","url":"https:\/\/www.searchviu.com\/","name":"SEO Data Warehouse And Monitoring","description":"SEO Solutions For Teams And Agencies","publisher":{"@id":"https:\/\/www.searchviu.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.searchviu.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.searchviu.com\/#organization","name":"searchVIU","url":"https:\/\/www.searchviu.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.searchviu.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.searchviu.com\/wp-content\/uploads\/2023\/02\/d3babe41-searchviu-logo2x.png","contentUrl":"https:\/\/www.searchviu.com\/wp-content\/uploads\/2023\/02\/d3babe41-searchviu-logo2x.png","width":340,"height":340,"caption":"searchVIU"},"image":{"@id":"https:\/\/www.searchviu.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/searchviu","https:\/\/www.linkedin.com\/company\/searchviu\/"]},{"@type":"Person","@id":"https:\/\/www.searchviu.com\/#\/schema\/person\/7a031e5565b9ece3fd77be3c7f19381c","name":"Eoghan Henn","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/bfa3d44dac21ee6e663defdfe4eb2ecb29ad85001375745329c7526fa74b95b7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/bfa3d44dac21ee6e663defdfe4eb2ecb29ad85001375745329c7526fa74b95b7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bfa3d44dac21ee6e663defdfe4eb2ecb29ad85001375745329c7526fa74b95b7?s=96&d=mm&r=g","caption":"Eoghan Henn"},"url":"https:\/\/www.searchviu.com\/en\/author\/eoghan\/"}]}},"modified_by":null,"_links":{"self":[{"href":"https:\/\/www.searchviu.com\/en\/wp-json\/wp\/v2\/posts\/2715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.searchviu.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.searchviu.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.searchviu.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.searchviu.com\/en\/wp-json\/wp\/v2\/comments?post=2715"}],"version-history":[{"count":1,"href":"https:\/\/www.searchviu.com\/en\/wp-json\/wp\/v2\/posts\/2715\/revisions"}],"predecessor-version":[{"id":6078,"href":"https:\/\/www.searchviu.com\/en\/wp-json\/wp\/v2\/posts\/2715\/revisions\/6078"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.searchviu.com\/en\/wp-json\/wp\/v2\/media\/1086"}],"wp:attachment":[{"href":"https:\/\/www.searchviu.com\/en\/wp-json\/wp\/v2\/media?parent=2715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.searchviu.com\/en\/wp-json\/wp\/v2\/categories?post=2715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.searchviu.com\/en\/wp-json\/wp\/v2\/tags?post=2715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}