Lee Willis

Adding Virtuemart Product Images to your Sitemap

| 11 Comments

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:

  1. Make sure you’re running version 1.2.7 of Xmap
  2. Take backups of all of these files from your existing Joomla! installation:
    • components/com_xmap/xmap.xml.php
    • administrator/components/com_xmap/extensions/com_virtuemart.xml
    • administrator/components/com_xmap/extensions/com_virtuemart.php
  3. Download com_virtuemart.xml and com_virtuemart.php from here, and save them into administrator/components/com_xmap/extensions/
  4. Download xmap.xml.php from the same place, and save it into components/com_xmap/
  5. 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:

Allow: /components/com_virtuemart/shop_image/product/

to the bottom of your robots.txt …

11 Comments

  1. Thanks for the info… just did the modifications. lets hope Google is publishing the pictures very soon !

  2. Hi there, thanks for your article. I was wondering if you had any thoughts on applying this to Jreviews?

    • I’m not sure I understand the question?

      • Thanks for your response.

        As you mentioned in your article, Xmap will only index images found in com_content. On a recent project we used Jreviews basically as a CCK for the site, but Xmap doesn’t play nice with Jreviews.

        I would like to see the images found in our Jreviews listings, to be included in the site map. I was wondering if you had any thoughts on applying the same principle that you did with Virtuemart to other components like Jreviews.

        Thanks!

        • I don’t think there’s even a com_xmap extension at all for JReviews is there? If there is, then adding image support should be fairly straightforward, but I haven’t ever used JReviews so I can’t say for sure.

  3. Thank you for sharing this, you really helped me a lot. I was battling trying to figure out the whole Virtuemert sitemap thing. You are the man.

  4. Very good, let me know if it works or what needs to change for version 1.2.8 thanks

  5. I am unsure of what the URL license means. There is not documentation. Are you able to explain that to me?

    • My understanding that it is a link to a page that explains the license terms of the image. Although you’re right there’s not a lot of documentation on it – so I can’t say for sure.

  6. Is there any recent update that will work for xmap 2.3.2 and vm 2.0.18?

Leave a Reply

Required fields are marked *.