Linux 软件免费装
Banner图

Smart LazyLoad – Lazy Load Images, Videos and Iframes

开发者 jumedeenkhan
mozedia
更新时间 2026年11月19日 15:36
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv3 or later
版权网址: 版权信息

标签

performance lazyload lazy load page speed lazy loading

下载

1.3.4 1.5 2.0.0 1.4.0 1.4.1 1.4.2 2.9.4 2.9.5 3.0.0 2.9.0 3.1.0

详情介绍:

Smart LazyLoad is the best free lazy load plugin for WordPress to lazy load images, videos, and iframes when they are about to enter the viewport. Instead of loading every resource at once, the browser only requests what a visitor can actually see, so pages open faster, use less bandwidth, and render with less layout shift. This LazyLoad plugin processes the entire rendered page at once, including post/page content, comments, widgets, thumbnails, avatars, and media associated with smilies. No jQuery or other third-party libraries and the script size is less than 10KB. What does Lazy Loaded? Main Features Three Loading Engines Choose the loading engine that best fits your website. Background images, offscreen load cancellation, and loading effects require Smart or Hybrid mode. Lightweight and Dependency-Free Built on vanilla-lazyload, the JavaScript engine requires no jQuery dependency. The lightweight script is under 10KB and loads only when required by your selected engine and enabled content types. Skip Important Image (LCP) Prevent important above-the-fold images from being lazy loaded. This helps ensure that important images load without unnecessary delays and supports better Largest Contentful Paint (LCP). Reduced Layout Shift Images without explicit width and height attributes can cause unexpected layout shifts while loading. Smart LazyLoad automatically fills in missing image dimensions from the image source, helping browsers reserve the required space before the image loads. Advanced Loading Controls Fine-tune how media is loaded with options for: Placeholders and Loading Animation Improve the loading experience with optional visual effects. Page Type & Custom Exclusions Control exactly where lazy loading is applied. Per-Post Lazy Loading Control Override the global lazy loading settings for individual posts, pages, and custom post types. Enable or disable lazy loading directly from the editor without changing your website-wide configuration. Compatibility with Other Plugins and Builders Smart LazyLoad includes compatibility controls to help prevent conflicts with other optimization tools. These options help avoid multiple lazy loading systems processing the same media. Dynamic Content Support Automatically process media added after the initial page load, including AJAX-loaded content and infinite scroll elements. No-JavaScript Fallback (Noscript) When JavaScript is disabled, deferred media is not lost. Processed images, iframes, and videos carry <noscript> fallbacks, and lazy-loaded backgrounds use fallback CSS, so content stays visible without scripting. Developer Friendly Every filter uses the smart_lazyload_ prefix, so code can control processing, thresholds, placeholders, exclusions, and final markup with a few lines. Setting the DONOTLAZYLOAD constant turns lazy loading off for a whole request, and WP-CLI commands generate or clear LQIP previews from the command line.

安装:

Automatic Installation
  1. Log in to your WordPress dashboard.
  2. Navigate to Plugins → Add New Plugin.
  3. Search for Smart LazyLoad.
  4. Click Install Now, then Activate.
  5. Navigate to Settings → Smart LazyLoad to configure your preferences.
Manual Installation
  1. Download the plugin ZIP file.
  2. Extract the lazy-load-for-images folder.
  3. Upload it to the /wp-content/plugins/ directory.
  4. Activate Smart LazyLoad from the Plugins screen.
  5. Open Settings → Smart LazyLoad to configure the plugin.
Images and whole-page processing are enabled by default. Iframes, videos, YouTube previews, and background images can be enabled separately.

屏幕截图:

  • General settings for lazy loading and exclusions.
  • Content-type settings for images, videos, iframes, and background images.
  • Performance settings for important images and loading behavior & controls.
  • Placeholder settings for Placeholder and loading animation settings.
  • Advanced settings for compatibility, export/import, and reset settings.
  • Per-post smart lazyload overrides controls in the post/page editor.

升级注意事项:

3.2.0
  • Smart LazyLoad now processes the entire rendered page in a single pass.
  • Previous per-fragment processing options have been removed.
  • Improvements for settings UI and lazy load engine.
  • Added export/import settings functionality.
  • Added automatic migration of existing settings.

常见问题:

Which loading engine should I use?

Start with Smart to get the full set of loading controls, including background images and loading effects. Choose Hybrid to let the browser handle supported images and iframes and use JavaScript for the rest. Choose Native for simple, browser-managed loading without the frontend library. Background images load only in Smart and Hybrid modes.

How can I use native lazy loading?

Set the engine to Native under Settings → General. Native mode uses the browser's built-in loading="lazy" attribute, so the JavaScript library is not loaded. To force native loading for every request regardless of the setting, use: add_filter( 'smart_lazyload_use_native_lazyload', '__return_true' );

How can I disable lazy loading on specific pages?

Use the page-type exclusions under Settings → General to skip the front page, blog index, archives, or search results. For a single post or page, use the Smart LazyLoad panel in the editor (Default / Enable / Disable). Developers can also turn processing off for any request with the smart_lazyload_enabled or do_smart_lazyload filters. For example, to skip only the search results page: ` add_filter( 'smart_lazyload_enabled', 'disable_smart_lazyload_on_search' ); function disable_smart_lazyload_on_search( $enabled ) { if ( is_search() ) { return false; } return $enabled; } `

How can I change the threshold that triggers loading?

Under Settings → Performance, set the Loading Threshold to the distance in pixels before the viewport at which media starts loading. The smart_lazyload_threshold filter can supply the value from code: ` add_filter( 'smart_lazyload_threshold', 'set_smart_lazyload_threshold' ); function set_smart_lazyload_threshold() { return 500; } `

How can I exclude YouTube videos from lazy load?

Turn off YouTube Thumbnails under Settings → Content to keep video embeds as normal iframes, or disable Iframes to leave all embeds untouched. The smart_lazyload_exclude_youtube_thumbnail filter takes an array of substrings: any embed whose markup contains one is kept as a normal iframe instead of getting a thumbnail. To keep one specific video as a player, add a substring to that array: ` add_filter( 'smart_lazyload_exclude_youtube_thumbnail', 'smart_keep_video_as_iframe' ); function smart_keep_video_as_iframe( $patterns ) { $patterns[] = 'youtube.com/watch?v=VIDEO_ID'; return $patterns; } ` The smart_lazyload_excluded_src filter skips any iframe by source URL substring. To leave a whole set of embeds untouched: ` add_filter( 'smart_lazyload_excluded_src', 'smart_skip_embeds_by_url' ); function smart_skip_embeds_by_url( $patterns ) { $patterns[] = 'youtube.com/embed/CHANNEL_ID'; return $patterns; } `

How can I lazy load a background image?

Enable Background Images under Settings → Content (and Background Variants if you use retina or image-set() markup). Backgrounds need Smart or Hybrid mode. For manual markup, set a URL on an element and the plugin handles it: <div class="smart-lazy-bg" data-bg="photo.jpg"></div> The smart_lazyload_bg_images_regex filter changes which background-image expressions are matched. To turn background-image lazy loading off entirely, use: add_filter( 'smart_lazyload_background_images', '__return_false' );

How can I keep the first (LCP) images from being delayed?

Under Settings → Performance, enable Protect Important Images and choose the first image, first two images, or a custom count. These stay eager so the likely Largest Contentful Paint image loads immediately. Existing loading="eager" and fetchpriority="high" hints are respected too.

How can I change the image placeholder for lazy-loaded images?

Under Settings → Placeholder, choose no placeholder, a low-quality image preview (LQIP), or a placeholder color, plus fade-in and spinner options. The smart_lazyload_svg_placeholder filter replaces the default transparent SVG, and smart_lazyload_placeholder changes the placeholder used for iframes. To drop the placeholder so the image stays blank until it loads: add_filter( 'smart_lazyload_dont_use_placeholder', '__return_true' );

How can I remove the noscript fallback?

Add the filter add_filter( 'smart_lazyload_noscript', '__return_false' );. The <noscript> tag is what keeps deferred images visible when JavaScript is disabled, so only remove it when you are sure you don't need that fallback.

How can I change the HTML output before it is sent to the browser?

Use the smart_lazyload_html filter to adjust the buffered HTML after all lazy-load passes have run:

How can I prevent a specific image from being lazy loaded?

There are several ways to exclude individual images:

  • Add loading="eager" or fetchpriority="high" to the image.
  • Add the skip-lazy, or no-lazyload CSS class in image.
  • Add the data-skip-lazy, data-no-lazy, or data-no-lazyload attribute.
You can also exclude elements by CSS class, ID, or source URL under General → Exclusions, or use the important-image protection in Performance.

Is Smart LazyLoad compatible with caching plugins and CDNs?

Yes. Smart LazyLoad processes the rendered frontend HTML without modifying your original media files. It works with most caching plugins and CDN configurations. After changing settings, clear your website cache and CDN cache so the updated settings take effect.

Does Smart LazyLoad work with page builders?

Yes. It processes the rendered frontend page, including content generated by page builders and theme templates. Page-builder editor previews are excluded automatically, and AMP pages are skipped by default.

Will my content remain visible if JavaScript is disabled?

Yes. Processed images, iframes, and videos include <noscript> fallbacks, and backgrounds use fallback CSS. Native mode relies on the browser's built-in behavior.

Can I disable WordPress or Jetpack lazy loading?

Yes. The Advanced tab has options to disable WordPress core lazy loading and Jetpack lazy loading so two systems never process the same media.

Are settings removed when I uninstall the plugin?

Not by default. Enable Advanced → Delete Data on Uninstall to remove settings, per-post overrides, and stored previews when the plugin is deleted. Deactivation never removes your settings.

Can I customize Smart LazyLoad using code?

Yes. Smart LazyLoad provides 18 developer filters covering processing, placeholders, thresholds, exclusions, markup, and media types:

  • do_smart_lazyload, smart_lazyload_enabled, smart_lazyload_threshold
  • smart_lazyload_use_native_lazyload, smart_lazyload_background_images
  • smart_lazyload_excluded_attachments, smart_lazyload_excluded_attributes, smart_lazyload_excluded_src, smart_lazyload_iframe_excluded_patterns
  • smart_lazyload_placeholder, smart_lazyload_svg_placeholder, smart_lazyload_dont_use_placeholder
  • smart_lazyload_noscript, smart_lazyload_html
  • smart_lazyload_youtube_resolution, smart_lazyload_exclude_youtube_thumbnail, smart_lazyload_youtube_html, smart_lazyload_iframe_html
  • smart_lazyload_bg_images_regex
The plugin also provides WP-CLI commands for generating and clearing LQIP previews.

更新日志:

3.2.0 3.1.0 3.0.0 2.9.5 2.9.4 2.9.3 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.1 2.4.0 2.3.0 2.2.0 2.1.0 2.0.2 2.0.1 2.0.0