问题原文
原帖链接 · Voko · CC BY-SA 4.0
I have a site where all my images are stored in a specific folder, for example /images/984728176386375837629856e.png but I don't want this page to appear on the SERP. Can I disable the indexing of the image folder with robots.txt?
社区高分解答
原帖链接 · Anuvesh · CC BY-SA 4.0
From the Google Search Console help docs:
If you want Google to exclude the
image-name-here.pngthat appears on your site atwww.example.com/images/image-name-here.png, add the following to your robots.txt file:User-agent: Googlebot-Image Disallow: /images/image-name-here.pngThe next time Google crawls your site, it will see this directive and drop your image from the search results.
To remove all the images on your site from being indexed, add the following to the robots.txt file in your server root:
User-agent: Googlebot-Image Disallow: /Additionally, Google has introduced increased flexibility to the robots.txt file standard through the use of asterisks. Disallow patterns may include "*" to match any sequence of characters, and patterns may end in "$" to indicate the end of a name.
To remove all files of a specific file type (for example, to include .jpg but not .png images), you'd use the following robots.txt entry:
User-agent: Googlebot-Image Disallow: /*.gif$
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
