# Turn Off WP Rocket Lazy Load on Chosen Pages

> Disables WP Rocket's image and iframe lazy loading on the pages you list, such as a gallery, slider page or landing page where above-the-fold images must load instantly.

- Type: PHP
- Runs: Run everywhere
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: wp-rocket, lazy-load, images
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/rocket-disable-lazyload-on-pages/

## Code

```php
$wpide_pages = array( 'home', 'gallery' ); // Page slugs or IDs.

add_action( 'wp', function () use ( $wpide_pages ) {
    if ( is_admin() || ! defined( 'WP_ROCKET_VERSION' ) || ! is_page( $wpide_pages ) ) {
        return;
    }

    add_filter( 'do_rocket_lazyload', '__return_false' );
    add_filter( 'do_rocket_lazyload_iframes', '__return_false' );
} );
```

## Notes

List page IDs or slugs in $wpide_pages. Clear WP Rocket's cache for those pages afterwards.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Turn Off WP Rocket Lazy Load on Chosen Pages" 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/
