{"id":1096,"date":"2023-10-09T01:27:00","date_gmt":"2023-10-09T01:27:00","guid":{"rendered":"https:\/\/blog.ngocha.biz\/?p=1096"},"modified":"2023-10-09T01:27:00","modified_gmt":"2023-10-09T01:27:00","slug":"wordpress-staging-noindex","status":"publish","type":"post","link":"https:\/\/blog.ngocha.biz\/?p=1096","title":{"rendered":"How to Stop Google from Indexing Your WordPress Staging Site"},"content":{"rendered":"<p>In this blog, I have explained different methods to disable wordpress website from Google indexing when you work with private, staging or testing websites.<\/p>\n<p>A staging or testing website is necessary for every WordPress website that needs continuous development and updates.<\/p>\n<p>I personally have staging websites for all the WordPress websites I manage. Whenever there is a plugin update, theme update, code customization, or trying out a new plugin, I always test it on my staging website first.<\/p>\n<p>Ideally, your staging website is a replica of the live website with most of its content. And you don\u2019t want Google to index the staging website and end up with duplicate content issues. Duplicate content would hurt your website&#8217;s SEO.<\/p>\n<h2 id=\"noindex-nofollow-to-disallow-search-engine-crawlers\">noindex, nofollow \u00a0To Disallow Search Engine Crawlers<\/h2>\n<p>For Google search engine robot not to index a page and not to follow links in the page, it should have noindex, nofollow in the page <a href=\"https:\/\/developers.google.com\/search\/docs\/crawling-indexing\/robots-meta-tag?ref=devopscube.com\" rel=\"noreferrer noopener\">Robots <code>meta<\/code> tag<\/a> as given below.<\/p>\n<pre><code>&lt;meta name=\"robots\" content=\"noindex, nofollow\" \/&gt;<\/code><\/pre>\n<p>In the WordPress staging website, we need this tag on every page to disallow Google search engine bots from indexing the page.<\/p>\n<p>You can follow any of the methods given below to enable these tags on your staging website. I have given step-by-step guides on implementing every method.<\/p>\n<h2 id=\"method-1-disable-search-engine-visibility-in-wordpress-setting\">Method 1: Disable Search Engine Visibility in WordPress Setting<\/h2>\n<p>WordPress has a native setting to discourage search engines from indexing the web pages.<\/p>\n<p>To enable the option, go to <strong>Settings&#8211;&gt; Reading<\/strong> and you will find an option called Search Engine Visibility. Select the checkbox and save the settings as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-52-8.png\" class=\"kg-image\" alt=\"Wordpress setting to disable search engine visibility\" loading=\"lazy\"><\/figure>\n<p>WordPress has a note saying &#8220;<em>It is up to search engines to honor this request<\/em>.&#8221; So it&#8217;s not a guarantee that google will stop indexing your website.<\/p>\n<h2 id=\"method-2-password-protect-the-staging-website\"><strong>Method 2: <\/strong>Password Protect the Staging Website<\/h2>\n<p>Using password protection is one of the best ways to discourage Google from indexing the staging website. In fact, Google recommends this approach. If you enable password protection for the whole website, the content can be accessed only using a password.<\/p>\n<p>You can implement password protection using the free <a href=\"https:\/\/wordpress.org\/plugins\/password-protected\/?ref=devopscube.com\" rel=\"noreferrer noopener\">Password Protected<\/a> WordPress plugin. It automatically adds <code>noindex,nofollow<\/code> meta tag to all the Password Protected content.<\/p>\n<p>Follow the steps given below to set up password protection for the whole staging website.<\/p>\n<p><strong>Step 1: <\/strong>Search for Password Protected plugin from the WordPress plugins option. Install and activate the plugin.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-33-19.png\" class=\"kg-image\" alt=\"Password Protected wordpress plugin for noindex\" loading=\"lazy\"><\/figure>\n<p><strong>Step 2: <\/strong>You will find the password protected option in the sidebar. Select the password protected settings as shown below<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-34-13.png\" class=\"kg-image\" alt=\"password protected plugin settings\" loading=\"lazy\"><\/figure>\n<p><strong>Step 3:<\/strong> In the settings, enable the password protected status and create a new password as shown in the image below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-35-15.png\" class=\"kg-image\" alt=\"password protected plugin password and IP option\" loading=\"lazy\"><\/figure>\n<p>You can whitelist only your IP in the <em><strong>Allow IP Addresses<\/strong><\/em> field. So you don&#8217;t need a password to access the staging website. You can get the public IP of your system by searching <strong><em>What is my IP<\/em><\/strong> in Google search as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-36-17.png\" class=\"kg-image\" alt=\"Getting Public IP from Google\" loading=\"lazy\"><\/figure>\n<p>Now your staging website is password protected and its content can be accessed by anyone with the password or a whitelisted IP. \u00a0Google search bots cannot access the content. This way the staging website content doesn&#8217;t get indexed.<\/p>\n<p>To test this, try to open the staging website in a guest profile or incognito mode. You will see a page asking for a password as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-37-20.png\" class=\"kg-image\" alt=\"password protected page example\" loading=\"lazy\"><\/figure>\n<p>To test it, after providing the password, try inspecting any of the pages and you will see the <strong><code>noindex, nofollow<\/code><\/strong> meta description as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-38-20.png\" class=\"kg-image\" alt=\"noindex, nofollow verification using HTML inspect.\" loading=\"lazy\"><\/figure>\n<p>I personally use this plugin for one of my standalone staging websites.<\/p>\n<h2 id=\"method-3-use-the-wp-staging-plugin\">Method 3: \u00a0Use the WP-Staging Plugin<\/h2>\n<p>If you want to create a staging website on the same server without the staging site getting indexed, <a href=\"https:\/\/devopscube.com\/recommends\/wpstaging\/\">WP-Staging plugin<\/a> is a great option.<\/p>\n<p>It will help you clone the entire website and set up a staging website in just one click. And the staging website by default has the <strong><code>noindex, nofollow<\/code><\/strong> tag added to it. So you don&#8217;t have to worry about the staging URL getting indexed in Google.<\/p>\n<h2 id=\"method-4-block-search-engine-bots-in-robots-txt-file\">Method 4: \u00a0Block Search Engine Bots in Robots.txt file<\/h2>\n<p>You can block search engine bots using the robots.txt file present in your WordPress root directory. You need to add the following to the <strong><code>robots.txt<\/code><\/strong> file.<\/p>\n<pre><code>User-agent: *\nDisallow: \/<\/code><\/pre>\n<p>If you don&#8217;t have the robots.txt file, you need to create one.<\/p>\n<p>If you are using the Rank Math SEO plugin, you can directly edit it using the settings as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-39-16.png\" class=\"kg-image\" alt=\"Robots.txt editing using Rank Math SEO Plugin.\" loading=\"lazy\"><\/figure>\n<p>If you are using the Yoast SEO plugin, you will find the robots.txt file editing option under <strong>Tools &#8211;&gt; File Editor<\/strong> Option.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-40-17.png\" class=\"kg-image\" alt loading=\"lazy\"><\/figure>\n<p>If you are using managed WordPress hosting, you can use an FTP tool to create\/edit the file.<\/p>\n<h2 id=\"removing-indexed-staging-website-pages-from-google\">Removing Indexed Staging Website Pages From Google<\/h2>\n<p>For some reason, if your staging website pages have been indexed by Google, you can get it removed<\/p>\n<p>I did some research on <a href=\"https:\/\/support.google.com\/webmasters\/answer\/9689846?hl=en&#038;ref=devopscube.com\">Google blog<\/a> and found out the recommended methods to remove the indexed pages from Google as shown in the image below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-41-17.png\" class=\"kg-image\" alt=\"recomended way to remove urls from google index.\" loading=\"lazy\"><\/figure>\n<p>The first step is to submit the removal request through the Google search console. You will find the Removals option as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-42-16.png\" class=\"kg-image\" alt=\"Google search console URL removal option\" loading=\"lazy\"><\/figure>\n<p>Next, ensure you have made your content private using password-protected mechanism so that Google will not re-index it again. Google blog itself says that implementing <strong><code>noindex<\/code><\/strong> tag is not a secure mechanism for already indexed pages.<\/p>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>When you <a href=\"https:\/\/devopscube.com\/wordpress-installation-guide\/\">set up a WordPress<\/a> staging website, always ensure it is not getting indexed by following the steps explained in the blog.<\/p>\n<p>We looked at different methods to stop Google from crawling the WordPress staging websites. Choose a method that is comfortable for you.<\/p>\n<p>For pages that are already indexed, make sure to follow the Google guidelines I&#8217;ve explained to make the removals permanent<\/p>\n<p>Hope this blog helps. If you have any questions or suggestions drop a comment below.<\/p>\n<hr>\n<p><strong>Ngu\u1ed3n:<\/strong> <a href=\"https:\/\/devopscube.com\/wordpress-staging-noindex\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Stop Google from Indexing Your WordPress Staging Site \u2014 DevOpsCube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/devopscube.com\/wordpress-staging-noindex\/<\/p>\n","protected":false},"author":1,"featured_media":1097,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1096","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/1096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1096"}],"version-history":[{"count":0,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/1096\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/media\/1097"}],"wp:attachment":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}