Image sitemap with srcset
« on: March 08, 2016, 02:03:34 PM »
Hello!

Our new wordpress theme uses "srcset"
Example:
<img width="220" height="164" src="[ External links are visible to forum administrators only ]" class="attachment-shop_catalog size-shop_catalog wp-post-image" alt="TEST" srcset="[ External links are visible to forum administrators only ] 220w, [ External links are visible to forum administrators only ] 138w" sizes="(max-width: 220px) 100vw, 220px" />

Problem:
The images sitemap generates URLs that lead into a 404 not found. The links look like this:
[ External links are visible to forum administrators only ]ör-300x122.jpg%20300w,%20https://www.mixcard.de/wp-content/uploads/2012/11/Basis_handyzubehör.jpg%20428w   

I would prefer to get a URL like [ External links are visible to forum administrators only ]ör.jpg

Please ignore the German Umlaut. This will be fixed.

Thank you in advance.
Re: Image sitemap with srcset
« Reply #1 on: March 09, 2016, 03:50:29 AM »
Hello,

in this case you can add "," in Exclude URLs and generator will ignore srcset attributes with multiple URLs in it.
Re: Image sitemap with srcset
« Reply #2 on: March 09, 2016, 10:58:18 AM »
Hi and thank you for your answer.
I tried to exclude URls containing "w,", but this only leads to ignoring the images.
Re: Image sitemap with srcset
« Reply #3 on: March 09, 2016, 02:39:50 PM »
What is an example page and image URL that is not included in sitemap?
Re: Image sitemap with srcset
« Reply #4 on: March 09, 2016, 05:54:36 PM »
Here you are.

URL: [ External links are visible to forum administrators only ]
Image:
<img class="alignnone size-full wp-image-2843" width="309" height="188" sizes="(max-width: 309px) 100vw, 309px" srcset="[ External links are visible to forum administrators only ] 300w, [ External links are visible to forum administrators only ] 309w" alt="pdf-download" src="[ External links are visible to forum administrators only ]">

Now the line is excluded because of the rule "w,"

I want this image to be in the sitemap:
[ External links are visible to forum administrators only ]

The URL of the image sitemap:
[ External links are visible to forum administrators only ]

Thank you
Re: Image sitemap with srcset
« Reply #5 on: March 10, 2016, 03:45:07 AM »
Yes, that is expected - all images defined in srcset with "," in it would be excluded in this case. You need to define one image per "src" or "srcset" attribute to include it in sitemap, multiple images in <img> tag are not supported.