{"id":2647879,"date":"2024-05-31T10:41:11","date_gmt":"2024-05-31T08:41:11","guid":{"rendered":"https:\/\/wp-rocket.me\/?p=2647879"},"modified":"2024-06-18T14:55:28","modified_gmt":"2024-06-18T12:55:28","slug":"lazy-loading-wordpress-5-5","status":"publish","type":"post","link":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/","title":{"rendered":"Lazy Loading in WordPress: Lazy Load Images, Videos, and More"},"content":{"rendered":"<p>Does your WordPress website use a lot of images? It wouldn\u2019t be a surprise, since they are <a href=\"https:\/\/httparchive.org\/reports\/state-of-images\">the most popular media format<\/a> on the web. However, at the same time, images can seriously slow down your site, which is why you need to know how to use lazy loading in WordPress.<\/p><p>We have talked about <a href=\"https:\/\/wp-rocket.me\/blog\/image-optimization-wordpress\/\">optimizing images<\/a> before, to make them as small as possible so they load quickly. However, there is a limit to how much you can shrink your image size without compromising quality. In addition, if you have lots of images on the same page, their size adds up, even if they have been optimized.<\/p><p>Lazy loading addresses this by preventing visuals that are not visible initially from being loaded. This helps <a href=\"https:\/\/wp-rocket.me\/blog\/critical-css\/\">reduce the Critical Rendering Path<\/a> and also improves <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-largest-contentful-paint\/\">Largest Contentful Paint<\/a>. In short, it positively impacts page loading time without compromising user experience.<\/p><p>Reason enough to put together a detailed guide on lazy loading in WordPress, don\u2019t you agree? That\u2019s why, in the following article, you\u2019ll learn how it works and how you can apply lazy loading to your site for the best results.<\/p><h2 class=\"wp-block-heading\">What Is Lazy Loading?<\/h2><p>Usually, when you open a web page, your browser loads all its data at once. Every image, text, link, etc. on it.<\/p><p>Especially with images, if there are a lot of them, this can take a long time. Images are much larger than other website elements. In addition, while the browser is busy with them, they often block other assets from loading, preventing your page from finishing the rendering process.<\/p><p>The result: Your visitors have to wait a long time to see the webpage they requested. And many won\u2019t stick around for that, which racks up your <a href=\"https:\/\/wp-rocket.me\/blog\/optimize-wordpress-bounce-rate\/\">bounce rate<\/a>.<\/p><p>Lazy loading prevents this by keeping images and other assets that are not initially visible on the screen from loading.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1500\" height=\"1532\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/google-images-lazy-loading-example.jpg\" alt=\"\" class=\"wp-image-6919132\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/google-images-lazy-loading-example.jpg 1500w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/google-images-lazy-loading-example-191x195.jpg 191w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/google-images-lazy-loading-example-768x784.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/google-images-lazy-loading-example-59x60.jpg 59w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/google-images-lazy-loading-example-88x90.jpg 88w\" sizes=\"(max-width: 1500px) 100vw, 1500px\" \/><\/figure><p>Instead, images further down the page only load successively when visitors scroll towards them. That way, they don\u2019t clog up the browser, so it can load other parts of the website more quickly. As a consequence, pages appear faster for visitors, leading to a better experience.<\/p><p>By the way, that\u2019s exactly what <a href=\"https:\/\/wp-rocket.me\/blog\/how-to-test-wordpress-site-performance-measure-speed-results\/\">speed testing tools<\/a> mean when they tell you to <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/defer-offscreen-images\/\">defer offscreen images<\/a>.<\/p><h3 class=\"wp-block-heading\">How Lazy Loading Works<\/h3><p>There are several ways to implement lazy loading. In the past, you needed some fancy JavaScript to do it. However, by now it has become a standard feature of browsers.<\/p><p>Consequently, you can simply mark images you want to load in this fashion with an HTML attribute, and your visitor browsers will do the rest.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1500\" height=\"391\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-attribute-in-browser-developer-tools.jpg\" alt=\"\" class=\"wp-image-6919150\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-attribute-in-browser-developer-tools.jpg 1500w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-attribute-in-browser-developer-tools-310x81.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-attribute-in-browser-developer-tools-768x200.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-attribute-in-browser-developer-tools-190x50.jpg 190w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-attribute-in-browser-developer-tools-345x90.jpg 345w\" sizes=\"(max-width: 1500px) 100vw, 1500px\" \/><\/figure><p>This is great because it makes it easy to implement, requires no extra code on your website, and standardizes the approach. Because it has become the de-facto standard, this is now also called \u201cnative lazy loading\u201d.<\/p><h3 class=\"wp-block-heading\">Benefits of Lazy Loading<\/h3><p>Now that you know how it works, what are the advantages of lazy loading images on your site?<\/p><ul class=\"wp-block-list\"><li><strong>Improved page loading times<\/strong> \u2013 We already discussed this. By preventing images and other media from initially loading, you can greatly speed up the time it takes for a web page to appear.<\/li>\n\n<li><strong>Reduced browser work<\/strong> \u2013 If images are lazy-loaded, your browser won\u2019t need to parse them until a visitor scrolls down the page.<\/li>\n\n<li><strong>Fewer HTTP requests<\/strong> \u2013 You\u2019ll also <a href=\"https:\/\/wp-rocket.me\/blog\/reduce-http-requests-speed-wordpress-site\/\">reduce the number of HTTP requests<\/a> and improve the Largest Contentful Paint grade.<\/li>\n\n<li><strong>Better user experience<\/strong> \u2013 Website visitors love fast-loading pages, so lazy loading can help with conversions and other engagement metrics.<\/li>\n\n<li><strong>Reduced server and CDN costs<\/strong> \u2013 Your server or CDN will have to download less data, resulting in cheaper bills if you have limited bandwidth.<\/li>\n\n<li><strong>Faster mobile performance<\/strong> \u2013 Images have greater impact on slower mobile connections. If you reduce them as a factor, your mobile users will especially benefit.<\/li>\n\n<li><strong>SEO benefits<\/strong> \u2013 Lazy loading improves <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/\">Core Web Vitals<\/a>, which are a Google ranking factor.<\/li><\/ul><h3 class=\"wp-block-heading\">Potential Drawbacks<\/h3><p>At the same time, lazy loading can also come with problems:<\/p><ul class=\"wp-block-list\"><li><strong>Performance issues<\/strong> \u2013 Using lazy load above the fold (logos, hero images, etc.) can actually have a negative effect on performance. That\u2019s because the Largest Contentful Paint element is likely an above-the-fold image, so it should load as quickly as possible. We\u2019ll talk about how to exclude images from lazy loading later.<\/li>\n\n<li><strong>SEO issues<\/strong> \u2013 If implemented incorrectly, you can prevent search engines from indexing lazy-loaded images. However, if you follow the instructions here, that should not be a problem.<\/li><\/ul><ul class=\"wp-block-list\"><li><strong>Layout shifts<\/strong> \u2013 When you don\u2019t define the size of images that are lazy loaded, it can lead to shifting website layout, which is bad for <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/improve-cumulative-layout-shift\/\">Cumulative Layout Shift<\/a>.<\/li>\n\n<li><strong>Potential conflicts<\/strong> \u2013 The functionality can clash with some plugins.<\/li>\n\n<li><strong>Impact on user experience <\/strong>\u2013 Lazy loading is visible when someone scrolls down the page really quickly.<\/li><\/ul><h3 class=\"wp-block-heading\">When to Use Lazy Loading<\/h3><p>So, when does it make sense to use this technique?<\/p><p>For the most part, it\u2019s most effective if you have a lot of images on your website, e.g. long blog articles with lots of screenshots. However, this can also apply to product or portfolio pages.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1317\" height=\"2048\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-in-ecommerce-scaled.jpg\" alt=\"\" class=\"wp-image-6919168\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-in-ecommerce-scaled.jpg 1317w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-in-ecommerce-125x195.jpg 125w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-in-ecommerce-768x1194.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-in-ecommerce-39x60.jpg 39w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-in-ecommerce-58x90.jpg 58w\" sizes=\"(max-width: 1317px) 100vw, 1317px\" \/><\/figure><p>As for which images exactly to lazy load, it should be those below the fold. This will reduce page loading time without affecting user experience. We already mentioned above that you should not apply lazy load to images above the fold, as this can negatively impact page loading time.<\/p><h2 class=\"wp-block-heading\">How to Lazy Load Images With Native Lazy Loading<\/h2><p>Enough with the theory, let\u2019s get to practical applications. As a first step, let\u2019s see how to implement lazy loading if you want to use the native browser solution.<\/p><h3 class=\"wp-block-heading\">The HTML Loading Attribute<\/h3><p>In order for browsers to apply lazy loading, website elements that should be delayed need to be marked with the &lt;loading=\u201clazy\u201d&gt; HTML attribute. Here\u2019s what it looks like in action:<\/p><pre class=\"wp-block-code\"><code class=\"\">&lt;img src=\"wp-rocket-is-awesome.jpg\" loading=\"lazy\" alt=\"WP Rocket\" \/&gt;\n&lt;iframe src=\"WP-Cache-Basics.html\" loading=\"lazy\"&gt;&lt;\/iframe&gt;\n<\/code><\/pre><p>The attribute takes two values:<\/p><ul class=\"wp-block-list\"><li><strong>lazy<\/strong> \u2013 Defers the loading of image or iframe elements.<\/li>\n\n<li><strong>eager<\/strong> \u2013 This is the standard loading behavior. The resource is requested immediately, regardless of its location.<\/li><\/ul><p>Currently, the loading attribute only supports &lt;img&gt; and &lt;iframe&gt; tags. For instance, you cannot use it to lazy-load CSS background images. We\u2019ll talk about options for that below.<\/p><p>In addition, since it has been adopted by pretty much every browser (see below), this methodology is also the safest in terms of indexing lazy loaded images for SEO. As long as there is a src attribute in the img tag, at least Google should not have any problems indexing your images.<\/p><p>Only if you implement lazy loading with JavaScript might it be a good idea to specify the src inside a &lt;noscript&gt; tag. That\u2019s for search engines whose crawlers can\u2019t handle JavaScript (again, Google can do it just fine).&nbsp;<\/p><p>In either case, additionally providing an image sitemap is a good idea.<\/p><h3 class=\"wp-block-heading\">Browser Support<\/h3><p>Lazy loading has become a de-facto web standard. According to <a href=\"https:\/\/caniuse.com\/loading-lazy-attr\">Can I Use<\/a>, it should work for more than 95% of global browser users.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1375\" height=\"493\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-browser-support.jpg\" alt=\"\" class=\"wp-image-6919177\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-browser-support.jpg 1375w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-browser-support-310x111.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-browser-support-768x275.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-browser-support-167x60.jpg 167w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loading-browser-support-251x90.jpg 251w\" sizes=\"(max-width: 1375px) 100vw, 1375px\" \/><\/figure><p>Besides that, even if you have implemented lazy loading on your site, it will not hurt the experience in a browser that doesn\u2019t support it.<\/p><h2 class=\"wp-block-heading\">Lazy Loading in WordPress: Built-In Options<\/h2><p>Since WordPress 5.5, the CMS lazy-loads images by default. The functionality was extended to iframes in version 5.7 and fine tuned in WordPress 5.9.<\/p><p>So, if your WordPress site is running on the latest version, any image or iframe that has a width and height attribute assigned to it, will automatically receive the &lt;loading=\u201dlazy\u201d&gt; attribute. This condition has been included to avoid the aforementioned Cumulative Layout Shift issues.<\/p><p>In addition, from WordPress 5.9 on, lazy loading will not apply to the first iframe or image on a page. This is to avoid LCP problems discussed earlier.<\/p><p>Aside from that, WordPress applies the attribute to images in the following places:<\/p><ul class=\"wp-block-list\"><li>Post content<\/li>\n\n<li>Post excerpts<\/li>\n\n<li>Text widgets<\/li>\n\n<li>Avatar images<\/li>\n\n<li>Images added as attachments<\/li><\/ul><h3 class=\"wp-block-heading\">Customization Options<\/h3><p>There are currently no no-code options to selectively switch off native lazy loading in WordPress for certain pages or images. If you want to do that, you need to use a plugin or some of the filters and functions below.<\/p><ul class=\"wp-block-list\"><li><a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_lazy_loading_enabled\/\">wp_lazy_loading_enabled<\/a> \u2013 You can use this to completely switch on and off lazy loading for images in certain contexts.<\/li>\n\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_filter_content_tags\/\">wp_filter_content_tags()<\/a> \u2013 Add srcset, sizes, and loading attributes to img HTML tags, as well as loading attributes to iframes.<\/li>\n\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_img_tag_add_width_and_height_attr\">wp_img_tag_add_width_and_height_attr()<\/a> \u2013 Used to apply width and height attributes to img tags which don\u2019t have them so lazy loading can apply to them.<\/li>\n\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_img_tag_add_srcset_and_sizes_attr\">wp_img_tag_add_srcset_and_sizes_attr()<\/a> \u2013 Include srcset and sizes attributes to existing img tags for similar purposes as above.<\/li>\n\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_img_tag_add_loading_attr\">wp_img_tag_add_loading_attr()<\/a> \u2013 Adds the loading attribute to img tags. For iframes, use wp_iframe_tag_add_loading_attr().<\/li>\n\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_omit_loading_attr_threshold\/\">wp_omit_loading_attr_threshold()<\/a> \u2013 Set a threshold for how many of the first images and iframes should be lazy loaded. Useful if your website shows several media elements above the fold and you want to disable lazy load for all of them.<\/li><\/ul><p>For examples on how to use the above to modify lazy loading in WordPress, check the announcements for <a href=\"https:\/\/make.wordpress.org\/core\/2020\/07\/14\/lazy-loading-images-in-5-5\/#customizing-lazy-loading\">WordPress 5.5<\/a>, <a href=\"https:\/\/make.wordpress.org\/core\/2021\/02\/19\/lazy-loading-iframes-in-5-7\/\">5.7<\/a>, and <a href=\"https:\/\/make.wordpress.org\/core\/2021\/12\/29\/enhanced-lazy-loading-performance-in-5-9\/\">5.9<\/a>.<\/p><h3 class=\"wp-block-heading\">Troubleshooting Tips<\/h3><p>If native lazy loading is not working on your WordPress site, it\u2019s likely because you are targeting elements without the &lt;img&gt; or &lt;iframe&gt; tags attached. Those are the only tags that WordPress natively lazy-loads. For other options, check the next section.<\/p><h2 class=\"wp-block-heading\">How to Enable WordPress Lazy Loading for Images and Videos via Plugin<\/h2><p>There are many <a href=\"https:\/\/wp-rocket.me\/blog\/best-lazy-load-plugins-wordpress\/\">plugin options for adding lazy loading to your site<\/a>. But, by far, the easiest way is WP Rocket. It takes less than a minute.<\/p><p>All you have to do is go to <strong>Settings &gt; WP Rocket &gt; Media<\/strong> in your WordPress admin dashboard.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1179\" height=\"964\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/enable-lazy-loading-in-wordpress-via-wp-rocket.jpg\" alt=\"\" class=\"wp-image-6919188\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/enable-lazy-loading-in-wordpress-via-wp-rocket.jpg 1179w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/enable-lazy-loading-in-wordpress-via-wp-rocket-238x195.jpg 238w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/enable-lazy-loading-in-wordpress-via-wp-rocket-768x628.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/enable-lazy-loading-in-wordpress-via-wp-rocket-73x60.jpg 73w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/enable-lazy-loading-in-wordpress-via-wp-rocket-110x90.jpg 110w\" sizes=\"(max-width: 1179px) 100vw, 1179px\" \/><\/figure><p>Check the boxes of the media types you want to enable lazy loading for:<\/p><ul class=\"wp-block-list\"><li>Images<\/li>\n\n<li>CSS background images<\/li>\n\n<li>iframes and videos<\/li><\/ul><p>In addition, you can have WP Rocket replace any embedded YouTube videos with a preview image. Finally, there is an option to add width and height attributes to images that are missing them, so they, too, can benefit from lazy loading.&nbsp;<\/p><p>Make your choices and click <strong>Save Changes<\/strong> at the bottom. Done.<\/p><h3 class=\"wp-block-heading\">Differences to Native Lazy Loading<\/h3><p>As you can already see from the above, WP Rocket\u2019s options go beyond native WordPress lazy loading. One of the main differences is that it also applies lazy loading to background images, both inline and those defined in CSS files. For example, here is markup compatible with this feature:<\/p><pre class=\"wp-block-code\"><code class=\"\">&lt;div style=\"background-image: url(image.jpg)\"&gt;\n<\/code><\/pre><p>You can read more on lazy loading background images with WP Rocket in our <a href=\"https:\/\/docs.wp-rocket.me\/article\/1141-using-lazyload-in-wp-rocket#background-images\">technical documentation<\/a>.<\/p><h3 class=\"wp-block-heading\">How to Check If Lazy Loading Is Working<\/h3><p>To see if lazy loading is successfully applied to your website, you can use the browser developer tools. Go to the <em>Network<\/em> tab and use the <em>Img<\/em> filter. Reload the page, and you should only see images above the fold in the list.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1500\" height=\"777\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/check-if-lazy-loading-for-wordpress-is-working.jpg\" alt=\"\" class=\"wp-image-6919204\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/check-if-lazy-loading-for-wordpress-is-working.jpg 1500w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/check-if-lazy-loading-for-wordpress-is-working-310x161.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/check-if-lazy-loading-for-wordpress-is-working-768x398.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/check-if-lazy-loading-for-wordpress-is-working-116x60.jpg 116w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/check-if-lazy-loading-for-wordpress-is-working-174x90.jpg 174w\" sizes=\"(max-width: 1500px) 100vw, 1500px\" \/><\/figure><p>When you start scrolling down, more and more images should appear. In addition, you should see the lazyload value under the <em>Initiator<\/em> column.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1500\" height=\"844\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loaded-images-in-browser-developer-tools-1.jpg\" alt=\"\" class=\"wp-image-6919215\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loaded-images-in-browser-developer-tools-1.jpg 1500w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loaded-images-in-browser-developer-tools-1-310x174.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loaded-images-in-browser-developer-tools-1-768x432.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loaded-images-in-browser-developer-tools-1-107x60.jpg 107w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/lazy-loaded-images-in-browser-developer-tools-1-160x90.jpg 160w\" sizes=\"(max-width: 1500px) 100vw, 1500px\" \/><\/figure><h3 class=\"wp-block-heading\">Troubleshooting Tips<\/h3><p>If you find that some of images are not lazy loaded even though you have activated the option, there are several possible reasons:<\/p><ul class=\"wp-block-list\"><li>Some types of images are excluded on purpose, such as WooCommerce product galleries<\/li>\n\n<li>The images contain one of a number of excluded attributes, such as data-src and data-no-lazy<\/li>\n\n<li>The image has been added dynamically with JavaScript<\/li>\n\n<li>There is a conflict with another plugin that adds lazy loading, or your theme has its own lazy-loading functionality<\/li><\/ul><p>For more information, read our documentation on <a href=\"https:\/\/docs.wp-rocket.me\/article\/1421-some-images-are-not-lazyloaded\">why some images are not lazyloaded<\/a>, <a href=\"https:\/\/docs.wp-rocket.me\/article\/278-common-issues-with-lazyload\">common issues with lazyload<\/a>, and <a href=\"https:\/\/docs.wp-rocket.me\/article\/38-lazyload-plugin-compatibility\">compatible plugins<\/a>.<\/p><h2 class=\"wp-block-heading\">How to Disable Lazy Loading in WordPress<\/h2><p>There are cases in which you want to disable lazy loading, either site wide, on an entire page, or for specific images. Here are different ways to do that.<\/p><h3 class=\"wp-block-heading\">Disable Native WordPress Lazy Loading Completely<\/h3><p>If you want to disable the built-in lazy loading on your WordPress website, you can do so with this code snippet:<\/p><pre class=\"wp-block-code\"><code class=\"\">add_filter( 'wp_lazy_loading_enabled', '__return_false' );\n<\/code><\/pre><p>Put it in the functions.php file of your (child!) theme. Alternatively, add it with a plugin like <a href=\"https:\/\/wordpress.org\/plugins\/wp-headers-and-footers\/\">Insert Headers and Footers<\/a> or <a href=\"https:\/\/docs.wp-rocket.me\/article\/142-how-to-make-a-custom-mu-plugin\">create your own MU-plugin<\/a>.<\/p><p>To disable native WordPress lazy loading in specific contexts or for certain images only, refer to the functions and filters in the <em>Customization Options<\/em> section above.<\/p><h3 class=\"wp-block-heading\">Switch Off Lazy Loading in WP Rocket<\/h3><p>You can disable the LazyLoad feature in WP Rocket just as easily as you enabled it. Go to the <strong>Media<\/strong> panel, uncheck the boxes, and save.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"941\" height=\"746\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/disable-lazy-loading-in-wp-rocket.jpg\" alt=\"\" class=\"wp-image-6919229\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/disable-lazy-loading-in-wp-rocket.jpg 941w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/disable-lazy-loading-in-wp-rocket-246x195.jpg 246w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/disable-lazy-loading-in-wp-rocket-768x609.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/disable-lazy-loading-in-wp-rocket-76x60.jpg 76w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/disable-lazy-loading-in-wp-rocket-114x90.jpg 114w\" sizes=\"(max-width: 941px) 100vw, 941px\" \/><\/figure><h3 class=\"wp-block-heading\">Exclude Lazy Loading for Specific Posts and Pages<\/h3><p>If you want to disable this feature only on a particular post or page, you can also do that with WP Rocket very easily. Open the page or post in the editor and find the WP Rocket Options in the sidebar (note, the content has to be published for it to be available).<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1176\" height=\"613\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/wp-rocket-options-to-disable-lazy-loading-on-individual-posts-and-pages.jpg\" alt=\"\" class=\"wp-image-6919244\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/wp-rocket-options-to-disable-lazy-loading-on-individual-posts-and-pages.jpg 1176w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/wp-rocket-options-to-disable-lazy-loading-on-individual-posts-and-pages-310x162.jpg 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/wp-rocket-options-to-disable-lazy-loading-on-individual-posts-and-pages-768x400.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/wp-rocket-options-to-disable-lazy-loading-on-individual-posts-and-pages-115x60.jpg 115w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/wp-rocket-options-to-disable-lazy-loading-on-individual-posts-and-pages-173x90.jpg 173w\" sizes=\"(max-width: 1176px) 100vw, 1176px\" \/><\/figure><p>Just uncheck the option you don\u2019t want to use and update the content. If any option is grayed out, you need to globally activate it in the WP Rocket settings first.<\/p><h3 class=\"wp-block-heading\">Remove Lazy Loading for Specific Images or iframes<\/h3><p>You can also disable lazy loading for particular media elements. You find that option in the <strong>Media<\/strong> panel of the WP Rocket settings.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"938\" height=\"741\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/exclude-individual-images-from-lazy-loading-in-wp-rocket.jpg\" alt=\"\" class=\"wp-image-6919261\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/exclude-individual-images-from-lazy-loading-in-wp-rocket.jpg 938w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/exclude-individual-images-from-lazy-loading-in-wp-rocket-247x195.jpg 247w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/exclude-individual-images-from-lazy-loading-in-wp-rocket-768x607.jpg 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/exclude-individual-images-from-lazy-loading-in-wp-rocket-76x60.jpg 76w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2024\/05\/exclude-individual-images-from-lazy-loading-in-wp-rocket-114x90.jpg 114w\" sizes=\"(max-width: 938px) 100vw, 938px\" \/><\/figure><p>Input the file name, CSS class, img attribute, domain name (for external images), or CSS file name of the image you don\u2019t want to load lazily in the box and save. More information and examples in the <a href=\"https:\/\/docs.wp-rocket.me\/article\/15-disable-lazy-load-on-specific-images\">documentation<\/a>.<\/p><p>Be aware, however, that you don\u2019t need to use this feature to exclude images above the fold from using lazy load. Because failing to do so can have such an impact on Largest Contentful Pain and the overall PageSpeed Insights score, <a href=\"https:\/\/wp-rocket.me\/blog\/wp-rocket-3-16\/\">WP Rocket does it automatically<\/a> without you having to lift a finger. If you have any other reasons to exclude images or iframes from lazy loading, you can still use the method described above.<\/p><h3 class=\"wp-block-heading\">Modify WP Rocket Lazy Loading Via Code<\/h3><p>If you want more control over how lazy loading works in WP Rocket, you can also modify it with markup. The snippets below go into your functions.php or a plugin for this purpose.<\/p><h3 class=\"wp-block-heading\">Conditionally Disable Lazy Loading<\/h3><p>We\u2019ll start off with a general function structure you can use to switch off lazy loading in different circumstances:<\/p><pre class=\"wp-block-code\"><code class=\"\">add_action('wp', function () {\n\n   \t \/\/ Declare condition set to false as a default\n   \t $condition = false;\n\n   \t \/\/ Build your condition logic to turn \u2018$condition\u2019 to \u2018true\u2019 when applicable\n\n   \t if ($condition) {\n\n   \t  \/\/ Disable Rocket Lazy Load if condition is met\n   \t  add_filter('do_rocket_lazyload', '__return_false');\n   \t \n   \t }\n    }\n);\n<\/code><\/pre><p>Next are some examples of how to use this approach.<\/p><h4 class=\"wp-block-heading\">Disable Lazy Loading on All Pages<\/h4><p>Use this if you want to lazy load images in your posts but not pages:<\/p><pre class=\"wp-block-code\"><code class=\"\">add_filter( 'wp', function () {\n   \t if ( is_page() ) {\n   \t\t add_filter('do_rocket_lazyload', '__return_false');\n   \t }\n    }\n);\n<\/code><\/pre><h4 class=\"wp-block-heading\">Switch Off Lazy Load on the Homepage<\/h4><p>Disable lazy loading for the front page of your site (the page you set in <strong>Settings &gt; Reading &gt; Front page<\/strong>):<\/p><pre class=\"wp-block-code\"><code class=\"\">add_filter( 'wp', function () {\n   \t if ( is_front_page() ) {\n   \t\t add_filter('do_rocket_lazyload', '__return_false');\n   \t }\n    }\n);\n<\/code><\/pre><h4 class=\"wp-block-heading\">Deactivate Lazy Load on Your Blog Page<\/h4><p>Same thing as above but for when you set your homepage to be a blog:<\/p><pre class=\"wp-block-code\"><code class=\"\">add_filter( 'wp', function () {\n   \t if ( is_home() ) {\n   \t\t add_filter('do_rocket_lazyload', '__return_false');\n   \t }\n    }\n);\n<\/code><\/pre><h4 class=\"wp-block-heading\">Remove Lazy Load on Single Posts<\/h4><p>To disable lazy loading on all single posts, but keep it for pages and your blog home page, use this snippet:<\/p><pre class=\"wp-block-code\"><code class=\"\">add_filter( 'wp', function () {\n   \t if ( is_single() ) {\n   \t\t add_filter('do_rocket_lazyload', '__return_false');\n   \t }\n    }\n);\n<\/code><\/pre><h4 class=\"wp-block-heading\">Disable LazyLoad on Specific Images<\/h4><p>You can tell WP Rocket not to use lazy loading on specific images with the data-no-lazy attribute:<\/p><pre class=\"wp-block-code\"><code class=\"\">&lt;img src=\"my-image.jpg\" data-no-lazy=\"1\" alt=\"\" width=\"100\" height=\"100\" \/&gt;\n<\/code><\/pre><h4 class=\"wp-block-heading\">Add a Fade-In Effect for Lazy-Loaded Images<\/h4><p>It can be a bit jarring for visitors when your lazy-loaded images appear out of nowhere on the page. Gradually showing images is a popular effect to improve that experience.<\/p><p>The following CSS snippet will add a fade-in effect to your site. Note that it goes to your style.css, not functions.php:<\/p><pre class=\"wp-block-code\"><code class=\"\">img[data-lazy-src] {\n    opacity: 0;\n}\n\nimg.lazyloaded {\n    -webkit-transition: opacity .5s linear 0.2s;\n    -moz-transition: opacity .5s linear 0.2s;\n    transition: opacity .5s linear 0.2s;\n    opacity: 1;\n}\n<\/code><\/pre><h4 class=\"wp-block-heading\">Adjust the LazyLoad Threshold<\/h4><p>By default, WP Rocket will load lazy-loaded images that are within 300 pixels of the browser window. You can adjust this threshold like so:<\/p><pre class=\"wp-block-code\"><code class=\"\">add_filter( 'rocket_lazyload_threshold', function ( $threshold ) {\n    return 100;\n});\n<\/code><\/pre><p>Note: In the above example, the threshold is set to 100px. Adjust the number to your liking.<\/p><h2 class=\"wp-block-heading\">Start Using Lazy Loading in WordPress Now<\/h2><p>Lazy loading is a great way to improve the performance of your website. It is most effective for sites that have a lot of images by preventing them and other media elements from being loaded until they actually appear on screen.<\/p><p>While WordPress now has native lazy loading by default, it doesn\u2019t come with a lot of controls for non-developers and only applies to images and iframe elements. If you want a more granular approach and also apply lazy loading to things like CSS backgrounds, going with a plugin solution like WP Rocket is the way to go. It gives you the ability to switch lazy loading off for certain parts of your site and even singular files.<\/p><p><a href=\"https:\/\/wp-rocket.me\/\">Give it a try now<\/a>. If you are not convinced, you can always count on our 100% money-back guarantee.<\/p>","protected":false},"excerpt":{"rendered":"<p>The ultimate lazy-loading guide for WordPress. How it works, benefits, and different methods of using and managing lazy loading in WordPress.<\/p>\n","protected":false},"author":335480,"featured_media":2647995,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"kia_subtitle":"","footnotes":""},"categories":[63],"tags":[],"class_list":["post-2647879","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-cache"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Lazy Loading in WordPress: Lazy Load Images, Videos, and More<\/title>\n<meta name=\"description\" content=\"The ultimate lazy-loading guide for WordPress. How it works, benefits, and different methods of using and managing lazy loading in WordPress.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Lazy Loading in WordPress: Lazy Load Images, Videos, and More\" \/>\n<meta property=\"og:description\" content=\"The ultimate lazy-loading guide for WordPress. How it works, benefits, and different methods of using and managing lazy loading in WordPress.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Rocket\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\" \/>\n<meta property=\"article:published_time\" content=\"2024-05-31T08:41:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-18T12:55:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/native-lazyload-wordpress-5-5.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"460\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nick Sch\u00e4ferhoff\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wp_rocket\" \/>\n<meta name=\"twitter:site\" content=\"@wp_rocket\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nick Sch\u00e4ferhoff\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/\"},\"author\":{\"name\":\"Nick Sch\u00e4ferhoff\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/person\/eeb53110f77bb3a3323467aa432b7798\"},\"headline\":\"Lazy Loading in WordPress: Lazy Load Images, Videos, and More\",\"datePublished\":\"2024-05-31T08:41:11+00:00\",\"dateModified\":\"2024-06-18T12:55:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/\"},\"wordCount\":2814,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/wp-rocket.me\/#organization\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/native-lazyload-wordpress-5-5.png\",\"articleSection\":[\"Page speed and caching\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/\",\"url\":\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/\",\"name\":\"Lazy Loading in WordPress: Lazy Load Images, Videos, and More\",\"isPartOf\":{\"@id\":\"https:\/\/wp-rocket.me\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/native-lazyload-wordpress-5-5.png\",\"datePublished\":\"2024-05-31T08:41:11+00:00\",\"dateModified\":\"2024-06-18T12:55:28+00:00\",\"description\":\"The ultimate lazy-loading guide for WordPress. How it works, benefits, and different methods of using and managing lazy loading in WordPress.\",\"breadcrumb\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#primaryimage\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/native-lazyload-wordpress-5-5.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/native-lazyload-wordpress-5-5.png\",\"width\":1100,\"height\":460,\"caption\":\"WP Rocket and Native LazyLoad on WordPress 5.5\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wp-rocket.me\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Page speed and caching\",\"item\":\"https:\/\/wp-rocket.me\/blog\/wordpress-cache\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Lazy Loading in WordPress: Lazy Load Images, Videos, and More\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wp-rocket.me\/#website\",\"url\":\"https:\/\/wp-rocket.me\/\",\"name\":\"WP Rocket\",\"description\":\"Plugin d&#039;optimisation de sites WordPress\",\"publisher\":{\"@id\":\"https:\/\/wp-rocket.me\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wp-rocket.me\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/wp-rocket.me\/#organization\",\"name\":\"WP Rocket\",\"url\":\"https:\/\/wp-rocket.me\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"width\":150,\"height\":41,\"caption\":\"WP Rocket\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\",\"https:\/\/x.com\/wp_rocket\",\"https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/person\/eeb53110f77bb3a3323467aa432b7798\",\"name\":\"Nick Sch\u00e4ferhoff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6620a6692d6405319e0813158b314e4b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6620a6692d6405319e0813158b314e4b?s=96&d=mm&r=g\",\"caption\":\"Nick Sch\u00e4ferhoff\"},\"description\":\"Content writer, entrepreneur, and digital marketer. Lover of languages. Based in Berlin but home anywhere that has an Internet connection. Bad at writing short bios.\",\"sameAs\":[\"https:\/\/wp-rocket.me\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Lazy Loading in WordPress: Lazy Load Images, Videos, and More","description":"The ultimate lazy-loading guide for WordPress. How it works, benefits, and different methods of using and managing lazy loading in WordPress.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/","og_locale":"en_US","og_type":"article","og_title":"Lazy Loading in WordPress: Lazy Load Images, Videos, and More","og_description":"The ultimate lazy-loading guide for WordPress. How it works, benefits, and different methods of using and managing lazy loading in WordPress.","og_url":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/","og_site_name":"WP Rocket","article_publisher":"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","article_published_time":"2024-05-31T08:41:11+00:00","article_modified_time":"2024-06-18T12:55:28+00:00","og_image":[{"width":1100,"height":460,"url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/native-lazyload-wordpress-5-5.png","type":"image\/png"}],"author":"Nick Sch\u00e4ferhoff","twitter_card":"summary_large_image","twitter_creator":"@wp_rocket","twitter_site":"@wp_rocket","twitter_misc":{"Written by":"Nick Sch\u00e4ferhoff","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#article","isPartOf":{"@id":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/"},"author":{"name":"Nick Sch\u00e4ferhoff","@id":"https:\/\/wp-rocket.me\/#\/schema\/person\/eeb53110f77bb3a3323467aa432b7798"},"headline":"Lazy Loading in WordPress: Lazy Load Images, Videos, and More","datePublished":"2024-05-31T08:41:11+00:00","dateModified":"2024-06-18T12:55:28+00:00","mainEntityOfPage":{"@id":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/"},"wordCount":2814,"commentCount":1,"publisher":{"@id":"https:\/\/wp-rocket.me\/#organization"},"image":{"@id":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/native-lazyload-wordpress-5-5.png","articleSection":["Page speed and caching"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/","url":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/","name":"Lazy Loading in WordPress: Lazy Load Images, Videos, and More","isPartOf":{"@id":"https:\/\/wp-rocket.me\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#primaryimage"},"image":{"@id":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/native-lazyload-wordpress-5-5.png","datePublished":"2024-05-31T08:41:11+00:00","dateModified":"2024-06-18T12:55:28+00:00","description":"The ultimate lazy-loading guide for WordPress. How it works, benefits, and different methods of using and managing lazy loading in WordPress.","breadcrumb":{"@id":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#primaryimage","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/native-lazyload-wordpress-5-5.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/native-lazyload-wordpress-5-5.png","width":1100,"height":460,"caption":"WP Rocket and Native LazyLoad on WordPress 5.5"},{"@type":"BreadcrumbList","@id":"https:\/\/wp-rocket.me\/blog\/lazy-loading-wordpress-5-5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wp-rocket.me"},{"@type":"ListItem","position":2,"name":"Page speed and caching","item":"https:\/\/wp-rocket.me\/blog\/wordpress-cache\/"},{"@type":"ListItem","position":3,"name":"Lazy Loading in WordPress: Lazy Load Images, Videos, and More"}]},{"@type":"WebSite","@id":"https:\/\/wp-rocket.me\/#website","url":"https:\/\/wp-rocket.me\/","name":"WP Rocket","description":"Plugin d&#039;optimisation de sites WordPress","publisher":{"@id":"https:\/\/wp-rocket.me\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wp-rocket.me\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wp-rocket.me\/#organization","name":"WP Rocket","url":"https:\/\/wp-rocket.me\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","width":150,"height":41,"caption":"WP Rocket"},"image":{"@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","https:\/\/x.com\/wp_rocket","https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q"]},{"@type":"Person","@id":"https:\/\/wp-rocket.me\/#\/schema\/person\/eeb53110f77bb3a3323467aa432b7798","name":"Nick Sch\u00e4ferhoff","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6620a6692d6405319e0813158b314e4b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6620a6692d6405319e0813158b314e4b?s=96&d=mm&r=g","caption":"Nick Sch\u00e4ferhoff"},"description":"Content writer, entrepreneur, and digital marketer. Lover of languages. Based in Berlin but home anywhere that has an Internet connection. Bad at writing short bios.","sameAs":["https:\/\/wp-rocket.me\/"]}]}},"_links":{"self":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/posts\/2647879"}],"collection":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/users\/335480"}],"replies":[{"embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/comments?post=2647879"}],"version-history":[{"count":0,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/posts\/2647879\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/media\/2647995"}],"wp:attachment":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/media?parent=2647879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/categories?post=2647879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/tags?post=2647879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}