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

Should I add the CDN or the source URL of an image to the XML image sitemap?

· 52CE 我爱测

I'm creating a WP plugin and I have the source URL for the image and the CDN URL to the image as well that is generated by replacing the host to the CDN host. Which is better, if I add the source URL and expose the image to the i…

问题原文

原帖链接 · Firsh - justifiedgrid.com · CC BY-SA 3.0

I'm creating a WP plugin and I have the source URL for the image and the CDN URL to the image as well that is generated by replacing the host to the CDN host. Which is better, if I add the source URL and expose the image to the index without the CDN, or add the CDN URL and risk that it's on a different domain or the CDN subdomain is not allowed to be in the sitemap? Perhaps there is something I'm missing that is better practice.

<loc>http://mydomain.com/my-page/</loc>
<lastmod>2013-05-19T13:44:58+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
<image:image>
    <image:loc>http://mydomain.com/myimage.jpg</image:loc>
    <image:title>A title</image:title>
    <image:caption>A caption</image:caption>
</image:image>

vs

<loc>http://mydomain.com/my-page/</loc>
<lastmod>2013-05-19T13:44:58+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
<image:image>
    <image:loc>http://cdn.possiblyanotherdomain.com/myimage.jpg</image:loc>
    <image:title>A title</image:title>
    <image:caption>A caption</image:caption>
</image:image>

已采纳解答

原帖链接 · Simon Hayter · CC BY-SA 3.0

I believe that Google will only follow that below to the TLD domain so subdomains such as cdn.yourdomain.com will work but a completely different domain will not. Most if not all CDN networks you can setup your domain to work in harmony with one another and should be no reason to use another domain.

Personally note:

In this day and age it's pretty pointless to include images within the sitemap, it only bloats the sitemap unnecessary. Google will never rank a image well purely based on a sitemap title or caption, it works out the image indexing based on the algorithm of the content of the page that the image it is found on and many on page factors confirm the picture contents. So when that page gets indexed so will the image.... so it's pretty pointless.

Google suggested images in sitemaps in 2009 I believe and so much has changed since then.

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

资料来源与适用范围

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

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

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