Add Product images (Drupal Commerce) to sitemap xml hooking

Created on 15 October 2018, over 6 years ago
Updated 18 May 2025, 20 days ago

Hi all,

I've been trying to show the images of my products in the xml sitemap for a long time but I can not get it.

I managed to show the images of the nodes of the type articles following the following example:
https://hardcoredev.com/blog/add-images-to-sitemap-xml-hooking-into-xmlsitemap-in-drupal/ but in the products (Product Display) does not work.

I use Drupal commerce and I think it's because it uses Products reference fields to show images.

I need some help.

Any ideas?

Thanks!

💬 Support request
Status

Active

Version

2.6

Component

Code

Created by

🇪🇸Spain bysv

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024