# Do Not Lazy-Load the First Images

> Tells WordPress to skip lazy loading for the first three images on a page, which usually improves Largest Contentful Paint.

- Type: PHP
- Runs: Frontend only
- Category: [Performance](https://wpide.com/library/category/performance/)
- Tags: performance, lazy-load, images, lcp
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/lazy-load-threshold/

## Code

```php
add_filter( 'wp_omit_loading_attr_threshold', function () {
    return 3;
} );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Do Not Lazy-Load the First Images" 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/
