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

How to force Google and other bots to pick actual images and not thumbnails?

· 52CE 我爱测

For example, if there is an online shopping websites with thousands of small thumbnails of products and when you click over them it shows actual retina/full HD image over a popup. In this scenario, how we can ensure that Google o…

问题原文

原帖链接 · Ravi Maniyar · CC BY-SA 3.0

For example, if there is an online shopping websites with thousands of small thumbnails of products and when you click over them it shows actual retina/full HD image over a popup. In this scenario, how we can ensure that Google or other bots should crawl only the retina/HD image and not the thumbnail when someone searches in Google images?

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 3.0

Link the thumbnails to the images for users that don't have JavaScript enabled. Like this:

<a href="full-image.jpg"><img src="thumb-nail.jpg"></a>

As long as users can see the full image by clicking, you can disable the click event on the link using JavaScript without incurring a penalty from Google.

Google treats links to images the same as actually having the full image in the page itself. Linking will get the full image to rank in image search and associate it with the correct page on your site.

You could also add a header to the thumbail images that prevents Google from indexing those:

X-Robots-Tag: noindex

If you have the Apache server you could use a directive in .htaccess like:

<FilesMatch ".*thumb.*\.(gif|jpg|jpeg|png)$">
    Header set X-Robots-Tag noindex
</FilesMatch>

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

资料来源与适用范围

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

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

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