Disabling LazyLoad on Specific Posts

If you want to disable LazyLoad on a specific post or page, you can do so directly on the Edit screen using the Cache Options meta box. Un-check the LazyLoad option and publish or update the post.

Edit screen with WP Rocket options

Note: This option will only be enabled if LazyLoad has been globally activated in Settings → WP Rocket → Basic Options.
The option was added in WP Rocket 2.5. In case you run an older version, our recommendation is to update to the latest version.

Disable LazyLoad programatically

You can programatically disable LazyLoad on specific posts or pages utilizing a WordPress filter. Although it is common practice to copy-paste code in the functions.php of a theme, we recommend for you to use a custom MU plugin as the preferable way of implementing customizations like the following examples.

How to make a custom MU plugin

Disable LazyLoad on All Pages

add_filter( 'wp', '__deactivate_rocket_lazyload_if_page' );
function __deactivate_rocket_lazyload_if_page() {
	if( is_page() ) {
		add_filter( 'do_rocket_lazyload', '__return_false' );
	}
}

Disable LazyLoad on Specific Types of Pages or Posts

If you want to disable LazyLoad for specific page templates or post types, you can use different Conditional Tags of WordPress. Here are few examples.

Disable LazyLoad on Front Page

The front page of your site is the one set in Settings → Reading → Front page displays. It can be an actual page, or an archive page with your latest blog posts.

add_filter( 'wp', '__deactivate_rocket_lazyload_if_page' );
function __deactivate_rocket_lazyload_if_page() {
	if( is_front_page() ) {
		add_filter( 'do_rocket_lazyload', '__return_false' );
	}
}

Disable LazyLoad on Blog Page

The blog page of your site is the one displaying an archive of your recent posts. It can be the front page, or any other page you have set to display such archive in Settings → Reading → Front page displays.

add_filter( 'wp', '__deactivate_rocket_lazyload_if_page' );
function __deactivate_rocket_lazyload_if_page() {
	if( is_home() ) {
		add_filter( 'do_rocket_lazyload', '__return_false' );
	}
}

Disable LazyLoad on Single Posts

A Single Post is the page you see when you open the permalink of a post.

add_filter( 'wp', '__deactivate_rocket_lazyload_if_page' );
function __deactivate_rocket_lazyload_if_page() {
	if( is_single() ) {
		add_filter( 'do_rocket_lazyload', '__return_false' );
	}
}

Disable LazyLoad on WooCommerce Product Pages

A Product Page in WooCommerce is the page you see when you open the permalink of a single product.

add_filter( 'wp', '__deactivate_rocket_lazyload_if_page' );
function __deactivate_rocket_lazyload_if_page() {
	if( is_singular( 'product' ) ) {
		add_filter( 'do_rocket_lazyload', '__return_false' );
	}
}

Note: As you can see, only one line of code changes in the above samples. The functions used in those lines are called Conditional Tags. To learn more about Conditional Tags in WordPress, check out the Codex page:
Conditional Tags