Im trying to include an auto-generated sitemap.xml file whenever we build our frontend application.

Unfortunately due to legacy reasons, we use the same frontend build script on our production and staging servers.

As a result , this sitemap.xml with domain as w.x.com will also reside on our w.staging.x.com server

There will be only one correct sitemap.xml file with hostname w.x.com residing on our w.x.com server - but there will be a duplicate XML in staging

Is this ok or will it affect SEO/Crawlers etc

  • Is your staging environment available to crawlers? If not then as far as they are concerned that doesn't exist – John Conde Jul 16 at 20:16
  • Is your staging domain and main domain both verified in GSC with the same owner? – DocRoot Jul 17 at 21:51
  • @DocRoot I'm sorry, are you referring to google search console? I don't recall doing any verification for my staging server. Basically both fall under the same domain right ? One is x.com and the other is staging.x.com – Kannaj Jul 22 at 15:11
  • @Kannaj Yes, Google Search Console. Unless you've explicitly added a "domain property" (relatively new) and verified using the DNS verification method then x.com and staging.x.com are seen as two different properties and would need to be verified separately (if you wanted to). – DocRoot Jul 31 at 19:29
  • i verified only for x.com but can also seem to add multiple properties like a.staging.x.com , a.qa.x.com – Kannaj Aug 3 at 15:24

This is not okay and it probably will affect your SEO.

Staging should not be indexed. This is because of duplicate content and crawling budget reasons.

You should only index your live version and show only live version pages within your sitemap.

| improve this answer | |
  • I fail to see how having an "incorrect/invalid" sitemap of on a staging site - for which you don't want indexed anyway - will have any effect on SEO of the main site (which would seem to be the concern here)? An "invalid" sitemap will simply be ignored. (The exception is if both sites are verified by the same owner in GSC - but the OP has not confirmed this. Either way, I don't see this as being "detrimental".) The concern is having the staging site crawlable in the first place (which again, the OP has not actually confirmed) - but that wasn't the question that was asked. – DocRoot Jul 21 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.