Mobile app version of vmapp.org
Login or Join
Ogunnowo487

: Preventing Google from indexing PDF Files 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

@Ogunnowo487

Posted in: #Google #GoogleSearch #Protection

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?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Ogunnowo487

3 Comments

Sorted by latest first Latest Oldest Best

 

@Eichhorn148

You could configure your server to use X-Robots-Tag=noindex HTTP header for PDF files.

If you are using apache with mod_headers, you could put this in your httpd.conf or .htaccess file:

<Files ~ ".pdf$">
Header append X-Robots-Tag "noindex"
</Files>

10% popularity Vote Up Vote Down


 

@Angela700

You need to outright block your files from anyone who hasn't paid, not just the Google spider! To prevent direct download links, you can either store the files outside your site root or use an .htaccess rule to deny all access to the PDF folder(s).

Once a user has paid, a PHP script can reach inside the inaccessible PDF folder and get the PDF to download.

10% popularity Vote Up Vote Down


 

@Nimeshi995

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme