# Converting staging env to production — noindex issue

**URL:** <https://discourse.roots.io/t/converting-staging-env-to-production-noindex-issue/21356>\
**Category:** trellis\
**Tags:** ansible, trellis\
**Created:** [August 30, 2021, 3:46pm UTC](https://discourse.roots.io/t/converting-staging-env-to-production-noindex-issue/21356 "2021-08-30T15:46:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![artshostak](https://discourse.roots.io/user_avatar/discourse.roots.io/artshostak/32/7986_2.png) [@artshostak](https://discourse.roots.io/u/artshostak)\
**Post date:** [August 30, 2021, 3:46pm UTC](https://discourse.roots.io/t/converting-staging-env-to-production-noindex-issue/21356/1 "2021-08-30T15:46:01Z")

</div>

As a follow up to this issue, which was resolved and closed:

> [@Site disappeared from search engines](https://discourse.roots.io/t/site-disappeared-from-search-engines/21111):
>
> Hello, Can anyone help me troubleshoot why a two-year old site with thousands of users a day has just recently disappeared from search engines/Google? The only recent change had to do with us switching servers from DigitalOcean to AWS, in which case a new environment (called ‘aws’ was created) — WP\_ENV was not initially set to Production, but I have since then redeployed the server and explicitly declared that variable. Here is all I know: (1) Tried to simply resubmit it through Webmaster tool…

Question still remains how to properly convert a staging site to production given that once you provision it as “staging” it attaches a `<meta name='robots' content='noindex, nofollow' />` tag in the opening lines of the `<head>` block.

Know it’s not a best practice, but in this case I have a teaser site that I am treating as staging with a proper production build that will replace it in a month time, but do need it to be indexed in the meantime. So any thoughts here would be greatly appreciated!

Any ideas and thanks in advance!

---

<div class="post-metadata">

**Author:** ![strarsis](https://discourse.roots.io/user_avatar/discourse.roots.io/strarsis/32/4543_2.png) [@strarsis](https://discourse.roots.io/u/strarsis)\
**Post date:** [August 30, 2021, 4:12pm UTC](https://discourse.roots.io/t/converting-staging-env-to-production-noindex-issue/21356/2 "2021-08-30T16:12:34Z")

</div>

The `noindex, nofollow` could be injected from WordPress core itself.  
WordPress offers a feature for preventing site indexation (as often intentional for non-public/duplicate/testing content in `development` and `staging` environments).

This can be either controlled via the admin backend or by using the `DISALLOW_INDEXING` constant. Note that the `production` environment constants/variables differ greatly from the `development` ones. [roots.io](http://roots.io) Bedrock makes extensive use of these (12-factor-app approach).

Bedrock site `development` environment configuration:

> <https://github.com/roots/bedrock/blob/master/config/environments/development.php>

Bedrock site `staging` environment configuration:

> <https://github.com/roots/bedrock/blob/master/config/environments/staging.php>

The Bedrock `production` sites (for some time now) don’t actually explicitly set constants/variables (as you can [see in the Bedrock repository](https://github.com/roots/bedrock/blob/master/config/environments/)), as the default state of a Bedrock site is being production-ready. The `staging` and `development` environments override or extend the `production` environment state.

So check whether you have adjusted the environment configuration for `production` and not accidentlly copied it over from `development`.

---

<div class="post-metadata">

**Author:** ![artshostak](https://discourse.roots.io/user_avatar/discourse.roots.io/artshostak/32/7986_2.png) [@artshostak](https://discourse.roots.io/u/artshostak)\
**Post date:** [August 30, 2021, 4:39pm UTC](https://discourse.roots.io/t/converting-staging-env-to-production-noindex-issue/21356/3 "2021-08-30T16:39:59Z")

</div>

Thanks @strarsis for the quick reply, so in my situation — I am using `staging` without the `DISALLOW_INDEXING` tag since it’s not actually implemented yet but pending:

> <https://github.com/roots/bedrock/commit/28374ded796f719c39d58a99b51444db71662c60>

The WP backend does not have the `Discourage search engines from indexing this site` enabled. Guess the mu-plugin is what was controlling it. Considering there are 3 places where this can be turned on (WP Settings, Must Use Plugin, and environment configs) — should we consider a simpler more consolidated approach here?

---

<div class="post-metadata">

**Author:** ![system](https://discourse.roots.io/user_avatar/discourse.roots.io/system/32/10306_2.png) [@system](https://discourse.roots.io/u/system)\
**Post date:** [October 11, 2021, 3:46pm UTC](https://discourse.roots.io/t/converting-staging-env-to-production-noindex-issue/21356/4 "2021-10-11T15:46:05Z")

</div>

Closed on October 11, 2021, 3:46pm UTC

This topic was automatically closed after 42 days. New replies are no longer allowed.
