We're now on LinkedIn: For news and resources from Google Search on making your site discoverable,
follow us on LinkedIn.
图片站点地图
图片站点地图可以告知 Google 您网站上的其他图片,尤其是 Google 可能无法通过其他方式找到的图片(例如,您的网站通过 JavaScript 代码获取的图片)。您可以创建单独的图片站点地图,也可以向现有站点地图添加图片站点地图标记;这两种方法对 Google 来说都没有问题。
图片站点地图以常规站点地图为基础,因此常规站点地图最佳实践也适用于图片站点地图。我们还建议您遵循发布图片的常规最佳实践。
图片站点地图示例
以下示例显示的是具有图片站点地图扩展的常规站点地图,其中包含两个 <url>
元素:
https://example.com/sample1.html
,其中包含两张图片
https://example.com/sample2.html
,其中包含一张图片
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>https://example.com/sample1.html</loc>
<image:image>
<image:loc>https://example.com/image.jpg</image:loc>
</image:image>
<image:image>
<image:loc>https://example.com/photo.jpg</image:loc>
</image:image>
</url>
<url>
<loc>https://example.com/sample2.html</loc>
<image:image>
<image:loc>https://example.com/picture.jpg</image:loc>
</image:image>
</url>
</urlset>
图片站点地图引用
image
标记在图片站点地图命名空间中定义:http://www.google.com/schemas/sitemap-image/1.1
为了确保 Google 能使用您的图片站点地图,您必须使用以下必需的标记:
必需的标记 |
<image:image> |
包含单张图片的所有相关信息。每个 <url> 标记最多可包含 1,000 个 <image:image> 标记。 |
<image:loc> |
图片的网址。
某些情况下,图片网址可能与您的主网站不在同一个网域中。即便如此也不必担心,只要您在 Search Console 中已验证这两个网域即可。例如,当您使用内容分发网络(如 Google 协作平台)托管图片时,请确保在 Search Console 中验证相应托管网站。此外,您应确保 robots.txt 文件允许抓取您想要编入索引的所有内容。
|
我们从文档中移除了以下标记和属性:<image:caption>
、<image:geo_location>
、<image:title>
、<image:license>
。如需了解详情,请参阅弃用公告。
其他资源
希望了解更多信息?请参阅以下资源:
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-25。
[null,null,["最后更新时间 (UTC):2025-02-25。"],[[["Image sitemaps inform Google about images on your site, including those loaded with JavaScript, which can be created separately or integrated into existing sitemaps."],["General sitemap best practices and image publishing guidelines should be followed for optimal image indexing."],["Each `\u003curl\u003e` tag in an image sitemap can contain up to 1,000 `\u003cimage:image\u003e` tags, with `\u003cimage:loc\u003e` specifying the image URL, even if hosted on a different verified domain."],["Previously supported tags like `\u003cimage:caption\u003e`, `\u003cimage:geo_location\u003e`, `\u003cimage:title\u003e`, and `\u003cimage:license\u003e` are now deprecated."],["You can submit your image sitemap to Google and combine it with other sitemap extensions for comprehensive indexing."]]],["Image sitemaps inform Google about images on a site, including those found via JavaScript. Create a separate image sitemap or add image tags to an existing one. Use the `\u003cimage:image\u003e` tag to enclose image details, allowing up to 1,000 per `\u003curl\u003e`, and utilize the `\u003cimage:loc\u003e` tag for the image's URL. Ensure both your main and any image hosting domains are verified in Search Console. Deprecated tags include `\u003cimage:caption\u003e`, `\u003cimage:geo_location\u003e`, `\u003cimage:title\u003e`, and `\u003cimage:license\u003e`.\n"]]