WordPress is adding nonsense srcset
-
Hi,
I want to use image in exact size 800x533px (registered size for WooCommerce Single products) and WordPress is still adding srcset and sizes attributes with nonsense values like this:
<img loading="lazy" decoding="async" width="800" height="533" src="https://www.mywebsite.com/media/2025/09/homepage-cestovani-800x533.png" class="attachment-woocommerce_single size-woocommerce_single wp-image-7256" alt="" srcset="https://www.mywebsite.com/media/2025/09/homepage-cestovani-800x533.png 800w, https://www.mywebsite.com/media/2025/09/homepage-cestovani-300x200.png 300w, https://www.mywebsite.com/media/2025/09/homepage-cestovani-1024x683.png 1024w, https://www.mywebsite.com/media/2025/09/homepage-cestovani-768x512.png 768w, https://www.mywebsite.com/media/2025/09/homepage-cestovani-990x660.png 990w, https://www.mywebsite.com/media/2025/09/homepage-cestovani-441x294.png 441w, https://www.mywebsite.com/media/2025/09/homepage-cestovani-150x100.png 150w, https://www.mywebsite.com/media/2025/09/homepage-cestovani.png 1536w" sizes="(max-width: 360px) 330px, (max-width: 800px) 100vw, 800px">Nonsense:
- It used original image 1536×1536 for <img width=”800″ height=”533″>
- = horribly bad aspect ratio, too big image
- etc.
There are 2 main problems:
- I set width=”800″ height=”533″ so I want to always use image image-800×533.jpg
- Even if I want to use smaller responsive images, I don’t want to use larger responsive images because I know that on any screen (100000x100000px) in layout the image will not show larger than 800x533px.
- Like: you have your website 1024 width so you know images on this website will be never more width than 1024.
- (Image is not used for anything like full screen detailed showing.
Is it known issue which WordPress is working on?
Is there a fix for now?
Regards,
Jiri Polacek
- It used original image 1536×1536 for <img width=”800″ height=”533″>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘WordPress is adding nonsense srcset’ is closed to new replies.