1

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 Answers1

1

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");
Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109