Lee Willis

Adding Post Thumbnails To Your Sitemap


Google recently blogged about Adding Images to your Sitemaps. When I read this my thoughts jumped straight to a friend’s site that is image-orientated, and could really benefit from this. His site uses WordPress’ post thumbnails to store an image against each post, and I wanted to get those images into his sitemap.

His site already uses the great Google XML Sitemaps plugin to auto-generate an XML sitemap, so I thought I’d have a go at extending it to support post thumbnails.

The resulting XML looks a little like this:

    <image:title>Hello world!</image:title>

Some notes on the above. The image title is set the same as the post’s title – which I figure should be a reasonable result, from a user and SEO point of view. The license URL is configurable (One per site).

I’ve submitted the code to the plugin author to hopefully get included, but if you can’t wait, there’s a patch file available here – just apply it with the “patch” utility.


Leave a Reply

Required fields are marked *.