大网数据广告活动
网站运营与故障问答

How to disallow Google crawling out of my website through images?

· 52CE 我爱测

I'm taking care of a website which has multiple images coming from exterior links. The thing is, those links are outgoing ones, and I want to avoid that as much as possible. I tough of one solution which was to add rel="nofollow"…

问题原文

原帖链接 · Baldráni · CC BY-SA 3.0

I'm taking care of a website which has multiple images coming from exterior links.

The thing is, those links are outgoing ones, and I want to avoid that as much as possible.

I tough of one solution which was to add rel="nofollow"to my links, but the thing is W3C is explicit about it: this is not allowed.

So my first question is: how would Google react to this?

The second thought I asked myself: could I tell Google via robots.txt not to crawl further? If yes, how am I supposed to do it?

I've read that regex is not allowed in robots.txt and I can't use something like Disallow: /*.jpg$ since I need some of my images to be crawled.

Edit:

I just thought of this:

User-agent: *    
Allow: /images/*.jpg$
Disallow: /*.jpg$

Since all of our personal images are located in a specific folder. Would it work?

已采纳解答

原帖链接 · Aakash · CC BY-SA 3.0

You are right, rel=nofollow is only for links. <img> tag can't have rel=nofollow attribute.

What do you mean by

disallow google to crawl out of my website through images?

Google bot doesn't crawl out when it encounters an external image. It just gives a positive (or sometimes negative) recognition to it and may index it - Google can't crawl an image. You website will be crawled as it is with or without external image links.

What rel=nofollow tells (in case of external link) google is that you are not positively recommending the website and merely providing a link. Even having external links without nofollow doesn't affect crawling of your website.

I am not sure if there is corresponding attribute similar to nofollow for images and it is rightly so because images can only be indexed and not crawled/followed. Whether to allow indexing of image or not is in the hands of the owner of the image (which is the external website) which can allow/disallow indexing of images through robots.txt but it isn't your decision.

User-agent: Googlebot-Image
Disallow: / 

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-05-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。