Where are the src and srcset sizes coming from?

Themes and plugins can use the add_image_size function to define image sizes. Whenever an image is uploaded, WordPress will generate a separate image file for every size that is defined.

Now, when you insert an image in your post, WordPress will ask you which size you want to use by default. This will be the src part of the image tag. Because most themes are responsive these days, WordPress will include other defined image sizes in srcset. Which ones these are is determined by a function called wp_calculate_image_srcset. This function contains several filters that allow you to influence which images are included.

tech