I wrote in a recent post about how to add post images into your sitemap based on WordPress post images. However I look after a couple of sites, and they’re not all WordPress. So I set off on a quest to add images to sitemaps on my Joomla! sites.
The good news is that my sitemap plugin of choice, Xmap, had recently added basic image support to their XML sitemaps. However, while Xmap can generate sitemaps for a wide variety of Joomla! components – the only one to have image support currently is the standard com_content extension. One of my main Joomla! sites though is a store based on Virtuemart, and I wanted to add product images to the sitemap.
The result is a revised version of the com_virtuemart extension for Xmap, and a small change to the Xmap XML output code.
To get things up and running there’s five simple steps:
- Make sure you’re running version 1.2.7 of Xmap
- Take backups of all of these files from your existing Joomla! installation:
- Download com_virtuemart.xml and com_virtuemart.php from here, and save them into administrator/components/com_xmap/extensions/
- Download xmap.xml.php from the same place, and save it into components/com_xmap/
- Configure the com_virtuemart extension under com_xmap settings in your Joomla! administrator area. Make sure you’ve got images turned on, and a license URL specified if you want one.
That’s it – your sitemap should now include images for all of your products.
PS. The default Joomla! robots.txt bans Googlebot from crawling the Virtuemart image folders, you can allow them, by adding:
to the bottom of your robots.txt …