Skip to content

Image Sitemaps: Check One Image Served from a CDN

Pair a page URL with its image URL, test what the image host returns and check its crawl rules before rechecking the XML.

A paper page connected by purple thread to a separate photograph of a walking shoe
Jack Lee
3 Min Read
Share
On This Page

A product page and its photo can live on different hosts. In an image sitemap, list the public page under its page URL and attach its image URL beneath it. Then check whether Google can reach the exact image address.

Pair one page with its CDN image

Suppose a Malaysian walking-shoe shop stores product photos on a separate image host. This sample connects a shoe page to one of the photos it displays.

<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/products/walking-shoe/</loc>
    <image:image>
      <image:loc>https://img.example.net/shoes/walking-shoe.webp</image:loc>
    </image:image>
  </url>
</urlset>

The outer loc identifies the page. The nested image:loc identifies the image file and uses Google's image sitemap namespace. Google documents cross-domain image URLs when both domains are verified in Search Console. Use the XML sitemap guide for the page-list format and submission.

Check the exact file on the image host

  1. Open the product page and identify the intended photo in the rendered page. Check that the sitemap's file is a public URL for that photo.
  2. Open the listed CDN URL without signing in. In the Network panel, verify the final status and content type. A 200 response serving an HTML interstitial or a generic placeholder still fails the photo check. Make sure the response displays the intended shoe photo.
  3. Inspect the robots rules on the CDN host for that exact file path. Verify ownership of the image host in Search Console so it can report crawl problems.

If the shop's page and CDN use different hosts, check both sets of rules. The storefront's robots file applies to its own host, protocol and port. Check the CDN's robots file separately.

Retest the listing after a CDN address change

If the photo moves to https://img.example.net/shoes/walking-shoe-v2.webp, replace only the nested image location for this entry. The product page address stays the same. Reopen the published XML and check both fields before using the new image URL for another fetch test. Test that file again and confirm Search Console can read the sitemap.

An image sitemap can help Google discover a file that appears on the page. See the image SEO guide for the image and the information that surrounds it on the product page.

Frequently asked questions

Can images be on a different host from the sitemap?

Yes. Google supports cross-domain image locations in an image sitemap. Verify the site and image host and make sure the required image is crawlable.

I can open the image. Why check robots rules?

A public image can still be disallowed for a crawler. Check the exact path against the rules served by the image host.

Does a successful sitemap submission mean the image is indexed?

No. Submission helps Google discover the file. It does not confirm that Google indexed it or will show it in Images.

Share This Article