Preventing Google from indexing PDF Files

5,610

You can block Google indexing certain file extensions by using the robots.txt file on your server.

SOURCE: Block or Remove Pages robots.txt

To block files of a specific file type (for example, .gif), use the following:

User-agent: Googlebot Disallow: /*.gif$

The above will block Google from indexing gif files and obviously you just adjust the code to: User-agent: Googlebot Disallow: /*.pdf$ if you want to block all search engines rather than just Google you can use: Disallow: /*.pdf$.

This can cause the issue of not indexing PDF files that you want indexing and therefor if you do not want to block based on file extension would be to use:

Disallow: /path/to/pdf/thefilename.pdf

Share:
5,610

Related videos on Youtube

user29531
Author by

user29531

Updated on September 18, 2022

Comments

  • user29531
    user29531 over 1 year

    I sell PDF patterns and when someone types my website and file type PDF in Google, all of my patterns for sale are listed to download for free. I use WordPress and Jigoshop. I need to find a way to block the PDF files from coming up in a Google search but still make them available to download when a customer purchases them. Any ideas?