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="https://www.mixcard.de/wp-content/uploads/2016/02/4-220x164.jpg" class="attachment-shop_catalog size-shop_catalog wp-post-image" alt="TEST" srcset="https://www.mixcard.de/wp-content/uploads/2016/02/4-220x164.jpg 220w, https://www.mixcard.de/wp-content/uploads/2016/02/4-138x103.jpg 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:
https://www.mixcard.de/wp-content/uploads/2012/11/Basis_handyzubehö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 https://www.mixcard.de/wp-content/uploads/2012/11/Basis_handyzubehö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.
Oleg Ignatiuk
www.xml-sitemaps.com
Send me a Private Message

For maximum exposure and traffic for your web site check out our additional SEO Services.
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?
Oleg Ignatiuk
www.xml-sitemaps.com
Send me a Private Message

For maximum exposure and traffic for your web site check out our additional SEO Services.
Re: Image sitemap with srcset
« Reply #4 on: March 09, 2016, 05:54:36 PM »
Here you are.

URL: https://www.mixcard.de/katalog-download/
Image:
<img class="alignnone size-full wp-image-2843" width="309" height="188" sizes="(max-width: 309px) 100vw, 309px" srcset="https://www.mixcard.de/wp-content/uploads/2015/03/pdf-download-300x183.png 300w, https://www.mixcard.de/wp-content/uploads/2015/03/pdf-download.png 309w" alt="pdf-download" src="https://www.mixcard.de/wp-content/uploads/2015/03/pdf-download.png">

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

I want this image to be in the sitemap:
https://www.mixcard.de/wp-content/uploads/2015/03/pdf-download.png

The URL of the image sitemap:
https://www.mixcard.de/sitemap_images.xml

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.
Oleg Ignatiuk
www.xml-sitemaps.com
Send me a Private Message

For maximum exposure and traffic for your web site check out our additional SEO Services.