in my site which produces a pdf file with MVC 5 and the file is no longer created. Does anyone " /> in my site which produces a pdf file with MVC 5 and the file is no longer created. Does anyone " /> in my site which produces a pdf file with MVC 5 and the file is no longer created. Does anyone "/>

Googlebot and create PDF

40 Views Asked by At

I just added <meta name="googlebot" content="noindex"> in my site which produces a pdf file with MVC 5 and the file is no longer created.
Does anyone have any idea how the file can be created and at the same time not be indexed by Google?

1

There are 1 best solutions below

0
Stephen Ostermiller On

PDF files can't use HTML meta tags. Instead you can use HTTP headers to prevent indexing. In MVC 5, the code for doing so would look something like:

context.Response.Headers.Add("X-Robots-Tag", "googlebot: noindex");