Disable Responsive Image srcset
Stops WordPress from adding srcset and sizes attributes to images, for sites where an image CDN already serves the right size.
Opens WPIDE on
Code
add_filter( 'wp_calculate_image_srcset', '__return_false' );
Notes
Without a CDN that resizes images, phones will download full-size images.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.