Add Images to Your Sitemap.xml

posted Thursday, November 20th 2014 at 8:05 AM by

Dilophosaurus recommends including images in your Sitemap

I wrote a quick blurb about how Sitemaps help SEO, and why your website should have a sitemap.xml file. This is a quick add on to cover something we didn't talk about in the first article: including references to images in your sitemap.

The first thing to note about including images in a Sitemap is that they are included inside a parent <url> tag, as a sibling element of the <loc> tag. This tells search crawlers which images are used on that URL. So when humans do a search for images, the crawlers will already have discovered your images and where those images are used on your site. This is huge because its a way for you to associate images with the content of the page. Now you can tell the search crawlers to associate a specific image with the keyword rich content you've written for a specific page. Lets look at an example/

<?xml version="1.0" encoding="UTF-8"?>



In this example, we've got two pages listed (each wrapped in <url> tags), one for Paris and one for New York. In this example, there's one image associated with the Paris page, and two images associated with the New York page. If you've got a good understanding of how to build a Sitemap, you'll see that adding images basically extends the sitemap.xml for pages by adding <image:image> tags for the URLs listed. Next, lets take a closer look at the tag elements.


I covered the Sitemap elements in my previous post about building an XML Sitemap, so I'll only touch on the additional tags you'll need to know.

Tag Required Description
<image:image> Yes This is the parent tag for an image. It must be a child of <url> in the XML document.
<image:loc> Yes This is the absolute path to the image. Remember to include the full domain.
Final Thoughts

Adding images to your Sitemap is a great way to not only help search crawlers find your images, but to help them understand what the content and context of the images. For some tips on how to automate this process, stay tuned for a follow up post on how to automate this process, including an update to Homebräu!

Hope that helps!

Share This:



View (0) Comments Post a Comment
  • Replying to Adam Konieska on Add Images to Your Sitemap.xml