# 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.

- Type: PHP
- Runs: Run everywhere
- Category: [Disable Features](https://wpide.com/library/category/disable-features/)
- Tags: disable, images, srcset
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/disable-responsive-srcset/

## Code

```php
add_filter( 'wp_calculate_image_srcset', '__return_false' );
```

## Notes

Without a CDN that resizes images, phones will download full-size images.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Disable Responsive Image srcset" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
