Prevent Search Engine Indexing of Angular 5 Website - Firebase

后端 未结 2 1175
悲&欢浪女
悲&欢浪女 2021-01-04 10:12

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

相关标签:
2条回答
  • 2021-01-04 10:51

    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

    0 讨论(0)
  • 2021-01-04 11:08

    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.)

    0 讨论(0)
提交回复
热议问题