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?
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?
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");