Title: missing srcset and sizes attributes
Last modified: August 22, 2020

---

# missing srcset and sizes attributes

 *  [George](https://wordpress.org/support/users/georgevoronca/)
 * (@georgevoronca)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/missing-srcset-and-sizes-attributes/)
 * Hello guys,
 * I decided to write here after searching a lot a solution on the internet (including
   this forum and documentation section). After testing my self hosted WordPress
   site speed with two browsers (Chrome and Firefox), I noticed that some posts 
   contain several image tags without srcset and sizes attributes. As browsers display,
   only the full or scaled sizes are downloaded which affects badly my site performance(
   especially on mobile version).
 * I don’t know why some images are served properly and other not. I checked the
   upload folder location and all images are generated accordingly with multiple
   sizes (e.g thumbnail, medium, medium-large, large).
 * Other details:
    – WP version is 5.5; – I use my custom theme where I set “wp_calculate_image_sizes”
   hook within functions.php file based on screen width. – running plug-ins – JetPack,
   Yoast
 * Hope it helps.
    Thanks for trying to support me!

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [5 years, 12 months ago](https://wordpress.org/support/topic/missing-srcset-and-sizes-attributes/#post-13298090)
 * Please provide a link to a page on your site where we can see this. Thanks. _Note:
   Your link will be public and we will not later remove it._
 * How were those images added to the post/page?
 *  Thread Starter [George](https://wordpress.org/support/users/georgevoronca/)
 * (@georgevoronca)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/missing-srcset-and-sizes-attributes/#post-13298121)
 * Hi Steven,
 * This is the [link](https://onnewrealms.com/2020/02/28/overnight-train-in-vietnam/)
   to one of the posts.
 * The images were uploaded through media gallery and then inserted within the post
   editor.
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [5 years, 12 months ago](https://wordpress.org/support/topic/missing-srcset-and-sizes-attributes/#post-13298142)
 * I see. Are you using the block editor or the classic editor?
 *  Thread Starter [George](https://wordpress.org/support/users/georgevoronca/)
 * (@georgevoronca)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/missing-srcset-and-sizes-attributes/#post-13298165)
 * I use the classic editor. I compared the HTML markup of the “good” and “bad” 
   posts and I did not see any difference. “Good” means posts with images tag having
   srcset and sizes attributes.
 * Edit 1: When I say HTML markup, I refer to the code within the block editor.
 * Edit 2: Just to avoid confusion. The HTML markup from the block editor is the
   same for image tags, no matter the post. On the other hand, from browsers some
   image tags do not have srcset and sizes at all.
    -  This reply was modified 5 years, 12 months ago by [George](https://wordpress.org/support/users/georgevoronca/).
    -  This reply was modified 5 years, 12 months ago by [George](https://wordpress.org/support/users/georgevoronca/).
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [5 years, 12 months ago](https://wordpress.org/support/topic/missing-srcset-and-sizes-attributes/#post-13298207)
 * Let’s test that it’s your theme. Switch to twentytwenty and make a new post to
   match the example. Do you get srcsets?
 *  Thread Starter [George](https://wordpress.org/support/users/georgevoronca/)
 * (@georgevoronca)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/missing-srcset-and-sizes-attributes/#post-13298272)
 * No, unfortunately I got the same behavior.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘missing srcset and sizes attributes’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [George](https://wordpress.org/support/users/georgevoronca/)
 * Last activity: [5 years, 12 months ago](https://wordpress.org/support/topic/missing-srcset-and-sizes-attributes/#post-13298272)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
