Roots Discourse

Converting staging env to production — noindex issue

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

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!

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. Bedrock makes extensive use of these (12-factor-app approach).

Bedrock site development environment configuration:

Bedrock site staging environment configuration:

The Bedrock production sites (for some time now) don’t actually explicitly set constants/variables (as you can see in the Bedrock repository), 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.

1 Like

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:

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?