2

I'm relatively new to Firebase Hosting. I have a web app that I'm working on and I have 2 Firebase Projects setup: 1 for my Production environment and 1for my Staging environments.

Ideally, I would want my Staging environment to NOT be indexed by Google.

Does anybody know if Google crawls Firebase hosted sites by default? If so, is the best way to prevent that to add a robots.txt that disallows all?

Any information would be much appreciated.

caseyli
  • 479
  • 5
  • 9

1 Answers1

2

I don't think Google treats a web app hosted on firebase any differently than a web app hosted anywhere else; Google automatically indexes everything it can find. Officially, Google finds websites by looking for links and sitemaps. So, if your staging environnement is not linked to anywhere and you don't submit a sitemap directly to Google, in theory you shouldn't get indexed.

But, I wouldn't just count on the fact that you're not putting links out there. Links might find themselves online for some reason at some point in the future.

You could add a robots.txt to your staging site with this value:

User-agent: *
Disallow: /

But in my experience, an even better solution is to make your staging site unaccessible without a username/password. That way, Google's bot won't be able to index anything else than a login form. And if people do find your staging URL, they won't be able to see what's going on there.


Most people actually try hard to be indexed very high and it's not that simple. Since your goal is to NOT rank high, should be very easy. It's like trying to not win a game.

Félix Paradis
  • 5,165
  • 6
  • 40
  • 49
  • also: https://stackoverflow.com/questions/48828630/prevent-search-engine-indexing-of-angular-5-website-firebase – Félix Paradis May 25 '20 at 15:10
  • If Google never finds the URL to a site, how does it know to start crawling it? The instruction to crawl has to come from somewhere, either a link or a request by the webmaster. – Doug Stevenson May 25 '20 at 15:41
  • @DougStevenson Good point, that's why I think not ranking well should be as easy as trying to lose at a casino. But the link might end up somewhere somehow, hence it makes sense to have a username/password protection, otherwise you're just betting on security through obscurity. Also, the domain has to be registered somewhere, so it's possible to know that there's something at x.tld just because it's registered. – Félix Paradis May 25 '20 at 18:20
  • But if Google never finds the URL, how would it rank at all? Do you think that Google just guesses URLs to crawl? That seems unnecessary and perhaps a waste of time. – Doug Stevenson May 25 '20 at 19:04
  • I don't think Google will rank a site if it cannot find a link to it or a sitemap. But just assuming that Google won't ever stumble on a particular link is not a very solid plan. Just think of Google Dorking, lots of sensitive information gets indexed even though no one asked for it. So might as well put a password protection on what you don't want exposed to the public, no? – Félix Paradis May 25 '20 at 20:50
  • The question is asking what happens "by default". No "by some action that we haven't yet determined". I would argue that "by default" no crawling will happen. – Doug Stevenson May 25 '20 at 20:56
  • I see your point. And I would agree that "by default", most probably nothing happens. – Félix Paradis May 25 '20 at 21:10