{"id":784,"date":"2024-05-07T11:43:17","date_gmt":"2024-05-07T11:43:17","guid":{"rendered":"https:\/\/kb.shortpixel.com\/docs\/native-lazy-loading-on-wordpress-5-5-and-spai-compatibility\/"},"modified":"2025-08-27T08:43:19","modified_gmt":"2025-08-27T08:43:19","password":"","slug":"native-lazy-loading-on-wordpress-5-5-and-spai-compatibility","status":"publish","type":"docs","link":"https:\/\/kb.shortpixel.com\/knowledge-base\/article\/native-lazy-loading-on-wordpress-5-5-and-spai-compatibility\/","title":{"rendered":"Native lazy loading on WordPress 5.5 and SPAI compatibility"},"content":{"rendered":"<p>\n\t In WordPress 5.5, images are lazy-loaded by default, using the<br \/>\n\t<a href=\"https:\/\/html.spec.whatwg.org\/multipage\/embedded-content.html#attr-img-loading\" rel=\"noopener\">native HTML&nbsp;<code>loading<\/code>&nbsp;attribute<\/a> which <a href=\"https:\/\/github.com\/whatwg\/html\/pull\/3752\" rel=\"noopener\">became a web standard earlier in 2020<\/a>. This means that&nbsp;WordPress will add&nbsp;<code>loading=\"lazy\"<\/code>&nbsp;to all&nbsp;<code>img<\/code>&nbsp;tags that have&nbsp;<code>width<\/code>&nbsp;and&nbsp;<code>height<\/code>&nbsp;attributes present.&nbsp;<\/p>\n<p>\n\t Now, if ShortPixel Adaptive Images (SPAI) is activated, it will lazy load all images, whether they have the mentioned attributes or not. If you wonder what happens between SPAI and WordPress 5.5, here are the two scenarios:<\/p>\n<section class=\"callout\">\nNote: The &#8220;Native lazy-loading&#8221; setting is located on Settings &gt; ShortPixel AI &gt; Behavior<\/section>\n<ul>\n<li>If the option &#8220;Native lazy-loading&#8221; is <strong>enabled<\/strong>, ShortPixel will add&nbsp;<code>loading=\"lazy\"<\/code>&nbsp;to <strong>all <\/strong>images, so the lazy-load effect will be similar to WordPress&#8217; default one. The only difference is that your images will be optimized and resized in addition to native lazy-loaded (because that&#8217;s SPAI&#8217;s purpose).\n<p>\t Note that there will<br \/>\n\t<strong>not <\/strong>be any duplicated attributes or any conflicts with WordPress&#8217; default behaviour.<\/p>\n<\/li>\n<li>If the option &#8220;Native lazy-loading&#8221; is <strong>disabled<\/strong>, ShortPixel will lazy load all images using JavaScript. <strong>This is a more efficient option<\/strong>, because the native lazy loading considers a very large viewport, meaning that for normal sites it loads almost all the images when the page loads, even if they are not visible. This makes native lazy-loading useful for&nbsp;very &#8220;long&#8221; pages with lots of images on them.\n<p>\t In this case, there is<br \/>\n\t<strong>no compatibility issue<\/strong> either.<\/li>\n<\/ul>\n<p>\n\t In short, it does not matter what method you use to lazy load your images: ShortPixel Adaptive Images will not cause any performance or compatibility issues with WordPress 5.5.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In WordPress 5.5, images are lazy-loaded by default, using the native HTML&nbsp;loading&nbsp;attribute which became a web standard earlier in 2020. This means that&nbsp;WordPress will add&nbsp;loading=&#8221;lazy&#8221;&nbsp;to all&nbsp;img&nbsp;tags that have&nbsp;width&nbsp;and&nbsp;height&nbsp;attributes present.&nbsp; Now, if ShortPixel Adaptive Images (SPAI) is activated, it will lazy load all images, whether they have the mentioned attributes or not. If you wonder what [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[35],"glossaries":[],"doc_tag":[],"class_list":["post-784","docs","type-docs","status-publish","hentry","doc_category-shortpixel-adaptive-images"],"blocksy_meta":[],"year_month":"2026-04","word_count":271,"total_views":"773","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"admin","author_nicename":"admin_mdli53m5","author_url":"https:\/\/kb.shortpixel.com\/author\/admin_mdli53m5\/"},"doc_category_info":[{"term_name":"ShortPixel Adaptive Images","term_url":"https:\/\/kb.shortpixel.com\/knowledge-base\/category\/shortpixel-adaptive-images\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/comments?post=784"}],"version-history":[{"count":1,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/784\/revisions"}],"predecessor-version":[{"id":2486,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/784\/revisions\/2486"}],"wp:attachment":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/media?parent=784"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_category?post=784"},{"taxonomy":"glossaries","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/glossaries?post=784"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_tag?post=784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}