How to disallow search engines from indexing .PDF files of Discourse instance?

The following steps prevents Google or any other search engine from indexing your pdf files to their search index. Let’s follow:

  • Go to your Discourse Admin > Settings (https://###DISCOURSEURL###/admin/customize/robots).
  • Add the following line:

    Disallow: /*.pdf

  • Save. That’s it!

Google or any other search cannot anymore index your PDF files in their search results!

Hope this helps.