| 开发者 |
jumedeenkhan
mozedia |
|---|---|
| 更新时间 | 2026年8月2日 22:04 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.2 及以上 |
| WordPress版本: | 7.0.2 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
<picture> sources, background images, native HTML5 videos, and iframes (including YouTube, vimeo) until they are about to enter the viewport.
Built with a lightweight, dependency-free frontend engine, Smart LazyLoad uses modern browser APIs without requiring jQuery or other third-party libraries. It also includes native browser lazy loading support, smooth loading effects, and intelligent defaults, so it works well immediately after activation.
Unlike most lazy load plugins, Smart LazyLoad gives you two levels of control. A global Master Switch lets you enable or disable lazy loading across your entire website, while a per-post override allows individual posts and pages to follow the global setting or force lazy loading on or off when needed.
Everything is managed from a clean, modern settings page where you can choose what to lazy load, fine-tune performance, customize placeholders and animations, and exclude specific elements for maximum compatibility.
lazy-load-for-images folder to /wp-content/plugins/Images inside post/page content, featured images, widget images, avatars, <picture> sources, CSS/inline background images, iframes (YouTube, Vimeo, and others), and native <video> elements. Each content type has its own on/off toggle, so you decide what applies.
Most lazy load plugins stop at <img> tags. Smart LazyLoad also handles background images, <picture> responsive sources, videos, and iframes, and adds a second layer of control on top of the usual site-wide switch: a per-post override that lets a single page behave differently from the rest of the site.
Yes, safely: on any page served through the AMP plugin, Smart LazyLoad detects the AMP endpoint and skips lazy loading entirely — including its scripts and styles — since AMP's markup rules don't allow the attributes lazy loading needs. Non-AMP pages are unaffected.
Open that post or page in the editor and find the Smart LazyLoad panel in the sidebar. Set the Lazy Load dropdown to Enable to force lazy loading on for that post only, or Disable to force it off — either way, every other post keeps following the site-wide Master Switch untouched.
No. Every other option on the settings page is dimmed and can't be edited while the Master Switch is off, but its saved value is untouched. Turn the Master Switch back on and your previous configuration is exactly as you left it.
Add any of these to the element: no-lazyload, skip-lazy, data-no-lazy, or data-skip-lazy. For your own classes or attributes, list them (comma-separated) under Settings → LazyLoad → Custom Exclude Selectors — no code needed.
Yes.
add_filter( 'do_smart_lazyload', '__return_false' );
Or conditionally, for example only on single posts:
add_action( 'wp', function () { if ( is_single() ) { add_filter( 'do_smart_lazyload', '__return_false' ); } } );
Yes, in two ways. Automatically, for any element using the inline style attribute: ` ` Or manually, using the plugin's own markup convention: ` `
<picture> markup?Yes. Every <source> inside a <picture> element has its srcset/sizes deferred in sync with the fallback <img>. The browser still decides which source to use based on format and viewport — Smart LazyLoad only changes when the chosen source loads.
When turned on, Smart LazyLoad shows a tiny, blurred version of the real image (generated from a registered thumbnail size) instead of an empty box while the full image loads. It's generated once per image, cached, and reused on every later page view. Choose the source size under Settings → LazyLoad → Placeholder Source Size.
On a large, existing media library, the first visitor to view each image pays a small one-time generation cost. Avoid that entirely by pre-generating every placeholder in advance from the command line:
wp smart-lazyload generate-lqip
Add --force to regenerate placeholders that are already cached (useful after changing the Placeholder Source Size).
Yes.
add_filter( 'smart_lazyload_svg_placeholder', function () { return 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1"></svg>'; } );
Deferred iframes use a separate placeholder (default about:blank), which you can change with:
add_filter( 'smart_lazyload_placeholder', function () { return 'about:blank'; } );
No. Smart LazyLoad only changes the HTML markup for images, videos, and iframes on the fly; it doesn't touch how pages are cached or served, so it works alongside typical caching and CDN setups.
Yes. Deferred content is always wrapped with a working <noscript> fallback, native browser lazy loading is supported directly, and the first image on the page is skipped by default so it doesn't hurt your Largest Contentful Paint score.
<body> existed<picture> elements had their <img> lazy-loaded by the Images option even when the picture option was off, leaving <source> and <img> out of sync; <picture> is now handled entirely by its own toggle<picture> elements, deferring each <source>'s srcset/sizes<video> lazy loading, including <source> tags and poster images