# Prevent google from indexing pdf files

**URL:** <https://meta.discourse.org/t/prevent-google-from-indexing-pdf-files/67767>\
**Category:** Support\
**Created:** [10 augustus 2017 om 09:40 UTC](https://meta.discourse.org/t/prevent-google-from-indexing-pdf-files/67767 "2017-08-10T09:40:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hnaseri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hnaseri/32/120660_2.png) [@hnaseri](https://meta.discourse.org/u/hnaseri)\
**Post date:** [10 augustus 2017 om 09:40 UTC](https://meta.discourse.org/t/prevent-google-from-indexing-pdf-files/67767/1 "2017-08-10T09:40:10Z")

</div>

Is there anyway to prevent search engines like google from indexing pdf files? I know that we can do something like

```
<Files ~ "\.pdf$">
  Header set X-Robots-Tag "noindex, nofollow"
</Files>

```

in htaccess for normal websites. But how this is possible for discourse?

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [29 juli 2019 om 14:08 UTC](https://meta.discourse.org/t/prevent-google-from-indexing-pdf-files/67767/4 "2019-07-29T14:08:50Z")

</div>



---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [30 juli 2019 om 06:16 UTC](https://meta.discourse.org/t/prevent-google-from-indexing-pdf-files/67767/5 "2019-07-30T06:16:31Z")

</div>

It is possible to manually edit `robots.txt` now. You can add

`Disallow: /*.pdf`

to your `robots.txt`

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [29 januari 2023 om 21:29 UTC](https://meta.discourse.org/t/prevent-google-from-indexing-pdf-files/67767/6 "2023-01-29T21:29:44Z")

</div>



---

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [29 januari 2023 om 21:34 UTC](https://meta.discourse.org/t/prevent-google-from-indexing-pdf-files/67767/7 "2023-01-29T21:34:02Z")

</div>


