How to block indexing certain file types using robot.txt
Posted: Sat Mar 13, 2010 6:38 am
I will configure the robot.txt file to avoid indexing PDF files in this example.
There are two methods.
See https://robot.lk/viewtopic.php?f=74&t=1474 for more information.
There are two methods.
- You can store all your PDF files inside a directory and block that being index by bots
Code: Select all
User-agent: * Disallow: /pdf-directory/
- Block PDF file types (since we use $ at the end, this will block any URL that ends with pdf)
Code: Select all
User-agent: * Disallow: /*.pdf$
Code: Select all
User-agent: Googlebot