Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make…
About Image Prioritizer
This plugin optimizes the loading of images and videos on your website by prioritizing them, implementing lazy loading, and accurately selecting image sizes. It requires the Optimization Detective plugin as a dependency and does not have any settings or user interface as it is designed to work without configuration. Please note that optimizations may not be immediately visible after activating the plugin and that they are not applied for administrator users by default.Frequently asked questions
What is Image Prioritizer?
Image Prioritizer is a WordPress plugin developed by the WordPress Performance Team. It optimizes the loading of images and videos to improve Largest Contentful Paint (LCP) and applies lazy loading.
How does Image Prioritizer improve LCP?
The plugin adds breakpoint-specific fetchpriority=high preload links for LCP image URLs. It ensures fetchpriority=high is only added to an IMG when it is the LCP element across all responsive breakpoints.
What are the lazy loading features?
Image Prioritizer applies lazy loading to IMG tags based on their visibility in the initial viewport. It also implements lazy loading for CSS background images and VIDEO tags, adjusting preload attributes based on their position.
Does it support different image types?
Yes, it supports IMG elements, the first SOURCE element in a PICTURE element (excluding art-directed PICTURE elements), and elements with CSS background-image inline styles or applied via stylesheets.
What about video optimization?
For videos, if a VIDEO is the LCP element, it gets preload=auto. If it's in an initial viewport, preload=metadata is used, and if not, it gets preload=none. Lazy-loaded videos also have initial preload, autoplay, and poster attributes restored upon entering the viewport.
Changelog
1.0.0-beta1
Enhancements
- Bump version to 1.0.0-beta1 to indicate graduation from being experimental. See 1846.
- Compute responsive
sizesattribute based on thewidthfrom theboundingClientRectin captured URL Metrics. (1840)
0.3.1
Bug Fixes
- Remove erroneous check for resource initiator type when considering whether to submit LCP background image. (1760)
0.3.0
Enhancements
- Add preload links LCP picture elements. (1707)
- Harden validation of user-submitted LCP background image URL. (1713)
- Lazy load background images added via inline style attributes. (1708)
- Preload image URLs for LCP elements with external background images. (1697)
- Serve unminified scripts when
SCRIPT_DEBUGis enabled. (1643)
0.2.0
Enhancements
- Lazy load videos and video posters. (1596)
- Prioritize loading poster image of video LCP elements. (1498)
- Choose smaller video poster image size based on actual dimensions. (1595)
- Add fetchpriority=low to occluded initial-viewport images (e.g. images in hidden carousel slides). (1482)
- Avoid lazy-loading images and embeds unless there are URL Metrics for both mobile and desktop. (1604)
0.1.4
Enhancements
- Move Auto Sizes logic from Enhanced Responsive Images to Image Prioritizer. (1476)
0.1.3
Bug Fixes
- Fix handling of image prioritization when only some viewport groups are populated. (1404)
0.1.2
- Update PHP logic to account for changes in Optimization Detective API. (1302)
0.1.1
- Fix background-image styled tag visitor’s handling of parsing style without background-image. (1288)
0.1.0
- Initial release.
