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?
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/
Solution 3
The simplest solution, add this to your <head>
:
<meta name="robots" content="noindex">
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.