Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Search Engine Indexing of Angular 5 Website - Firebase

How do I prevent my Angular 5 site from being indexed by search engines? I don't understand the documentation on Firebase indexing, and it seems like it refers specifically to indexing a mobile app, not an Angular website.

Would I add a robots.txt, or does Firebase use another method?

like image 946
Kellen Avatar asked Feb 16 '18 14:02

Kellen


2 Answers

A few things you can do:

Solution 1

If you have access to the domain name and/or administrative privileges to the websites' HTML, you can go to Google/Bing webmaster tools and block your site from being indexed from within their dashboard.

Solution 2

You can add a robots.txt file and disallow all. Here is an example:

User-agent: *
Disallow: /

...or disallow specific paths:

User-agent: *
Disallow: /foo/
Disallow: /bar/

Source

Solution 3

The simplest solution, add this to your <head>:

<meta name="robots" content="noindex">

Source


Note that whichever solution you go with, you probably need to go to Google/Bing webmaster tools to delete any links that have already been indexed, because they will still be there.

Remove Google URL's

Remove Bing URL's

like image 50
Lansana Camara Avatar answered Oct 12 '22 01:10

Lansana Camara


All references to robots.txt in the Firebase docs imply that you have to write it manually, and Google clearly states that a page without robots.txt will be indexed (or the robots meta tag or the X-Robots-Tag HTTP header). So yes, you'll have to write robots.txt manually.

As for your request from official sources, usually companies do not document automations they do not offer, so it'll be hard to see a list of all the automation that Firebase does not do for you.

Also, Angular does not create the robots.txt for you, but a quick look over the internet will show several tutorials explaining how to do so. Again, it is not documented that Angular does not do that, but if there was any automation... why would people post tutorials on how to do it manually? (Also, this rejected feature request.)

like image 41
Jofre Avatar answered Oct 12 '22 02:10

Jofre