LazyLoad Plugin icon
Performance & Caching

LazyLoad Plugin hooks reference

  • By WP Media
  • v2.4.1
  • Updated

LazyLoad Plugin 2.4.1 has 0 actions and 16 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Change a value LazyLoad Plugin is about to use
add_filter( 'rocket_lazyload_placeholder', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • inc/Dependencies/RocketLazyload/Iframe.php line 132 · used in 2 places
    /**
     * Filter the LazyLoad placeholder on src attribute
     */
    apply_filters( 'rocket_lazyload_placeholder', 'about:blank' );
  • inc/Lazyload/Subscriber.php line 247
    /**
     * Filters the lazyload application
     */
    apply_filters( 'do_rocket_lazyload', true );
  • inc/Dependencies/RocketLazyload/Image.php line 107
    /**
     * Regex to detect bg images inside CSS.
     */
    apply_filters( 'rocket_lazyload_bg_images_regex', 'background-image\s*:\s*(?<attr>\s*url\s*\((?<url>[^)]+)\))\s*;?' );
  • inc/Dependencies/RocketLazyload/Assets.php line 271
    /**
     * Filters the patterns excluded from lazyload for youtube thumbnails.
     */
    apply_filters( 'rocket_lazyload_exclude_youtube_thumbnail', [] );
  • inc/Dependencies/RocketLazyload/Image.php line 570
    /**
     * Filters the attributes used to prevent lazylad from being applied
     */
    apply_filters( 'rocket_lazyload_excluded_attributes', [ 'data-src=', 'data-no-lazy=', 'data-lazy-original=', 'data-lazy-src=', 'data-lazysrc=', 'data-lazyload=', 'data-bgposition=', 'data-envira-src=', 'fullurl=', 'lazy-slider-img=', 'data-srcset=', 'class="ls-l', 'class="ls-bg', 'soliloquy-image', 'loading="eager"', 'swatch-img', 'data-height-percentage', 'data-large_image', 'avia-bg-style-fixed', 'data-skip-lazy', 'skip-lazy', 'image-compare__', ] );
  • inc/Dependencies/RocketLazyload/Image.php line 612
    /**
     * Filters the src used to prevent lazylad from being applied
     */
    apply_filters( 'rocket_lazyload_excluded_src', [ '/wpcf7_captcha/', 'timthumb.php?src', 'woocommerce/assets/images/placeholder.png', ] );
  • inc/Dependencies/RocketLazyload/Image.php line 685
    /**
     * Filter the LazyLoad HTML output
     */
    apply_filters( 'rocket_lazyload_html', $image_lazyload );
  • inc/Dependencies/RocketLazyload/Iframe.php line 103
    /**
     * Filters the patterns excluded from lazyload for iframes
     */
    apply_filters( 'rocket_lazyload_iframe_excluded_patterns', [ 'gform_ajax_frame', 'data-no-lazy=', 'recaptcha/api/fallback', 'loading="eager"', 'data-skip-lazy', 'skip-lazy', 'google_ads_iframe_', ] );
  • inc/Dependencies/RocketLazyload/Iframe.php line 148
    /**
     * Filter the LazyLoad HTML output on iframes
     */
    apply_filters( 'rocket_lazyload_iframe_html', $iframe_lazyload );
  • inc/Lazyload/Subscriber.php line 145
    /**
     * Filters the arguments array for the lazyload script options
     */
    apply_filters( 'rocket_lazyload_script_args', $inline_args );
  • inc/Dependencies/RocketLazyload/Assets.php line 199
    /**
     * Filters the script tag for the lazyload script
     */
    apply_filters( 'rocket_lazyload_script_tag', '<script data-no-minify="1" async src="' . $args['base_url'] . $args['version'] . '/lazyload' . $min . '.js"></script>' );
  • inc/Lazyload/Subscriber.php line 104
    /**
     * Filters the threshold at which lazyload is triggered
     */
    apply_filters( 'rocket_lazyload_threshold', 300 );
  • inc/Dependencies/RocketLazyload/Iframe.php line 187
    /**
     * Filter the LazyLoad HTML output on Youtube iframes
     */
    apply_filters( 'rocket_lazyload_youtube_html', '<div class="rll-youtube-player" data-src="' . esc_attr( $youtube_url ) . '" data-id="' . esc_attr( $youtube_id ) . '" data-query="' . esc_attr( $query ) . '" data-alt="' . esc_attr( $title ) . '"></div>' );
  • inc/Lazyload/Subscriber.php line 174
    /**
     * Filters the resolution of the YouTube thumbnail
     */
    apply_filters( 'rocket_lazyload_youtube_thumbnail_resolution', 'hqdefault' );
  • inc/Lazyload/Subscriber.php line 411
    /**
     * Filters the use of native lazyload for images
     */
    apply_filters( 'rocket_use_native_lazyload', false );
  • smilies_src

    filter
    inc/Dependencies/RocketLazyload/Image.php line 828
    /**
     * Filter the Smiley image URL before it's used in the image element.
     */
    apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );

Generated from LazyLoad Plugin's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: