{"id":860,"date":"2024-05-07T11:44:36","date_gmt":"2024-05-07T11:44:36","guid":{"rendered":"https:\/\/kb.shortpixel.com\/docs\/spai-replace-method\/"},"modified":"2025-08-27T08:41:44","modified_gmt":"2025-08-27T08:41:44","password":"","slug":"spai-replace-method","status":"publish","type":"docs","link":"https:\/\/kb.shortpixel.com\/knowledge-base\/article\/spai-replace-method\/","title":{"rendered":"Settings &#8211; Replace method"},"content":{"rendered":"<p>\n\tThis modifies how SPAI will replace the images with the optimized ones (remember that <a href=\"https:\/\/help.shortpixel.com\/article\/132-how-shortpixel-adaptive-images-work\" rel=\"noopener\">SPAI changes the URL of the image<\/a>).<\/p>\n<ul>\n<li><strong>SRC<\/strong>: this is the&nbsp;recommended method. It makes sure&nbsp;the images remain only with the&nbsp;<code>src<\/code>&nbsp;attribute, which resizes to the placeholder (&#8220;adaptive images&#8221;).\n<ul>\n<li>Generate &lt;noscript&gt; tag: If you are in a browser that does not allow\/support JavaScript, then you should activate this in order to let SPAI work correctly. Please notice that this is&nbsp;not&nbsp;a &#8220;no-JavaScript&#8221; switch; this is a workaround, as SPAI works better if JavaScript is enabled.<\/li>\n<\/ul>\n<\/li>\n<li><strong>BOTH<\/strong>&nbsp;(experimental): it does the same as SRC, but it&nbsp;also keeps the&nbsp;<code>srcset<\/code>&nbsp;attribute while replacing images in it (but not resizing them).<\/li>\n<li><strong>SRCSET<\/strong>&nbsp;(experimental):&nbsp;it only replaces images in the&nbsp;<code>srcset<\/code>&nbsp;attribute. Please notice that you do not need to select this to have &#8220;adaptive images&#8221;; SRC already serves adaptive images.<\/li>\n<\/ul>\n<p>You should only choose BOTH or SRCSET if directed by support or if you are really sure you need them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This modifies how SPAI will replace the images with the optimized ones (remember that SPAI changes the URL of the image). SRC: this is the&nbsp;recommended method. It makes sure&nbsp;the images remain only with the&nbsp;src&nbsp;attribute, which resizes to the placeholder (&#8220;adaptive images&#8221;). Generate &lt;noscript&gt; tag: If you are in a browser that does not allow\/support JavaScript, [&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-860","docs","type-docs","status-publish","hentry","doc_category-shortpixel-adaptive-images"],"blocksy_meta":[],"year_month":"2026-04","word_count":182,"total_views":"1148","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\/860","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=860"}],"version-history":[{"count":1,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/860\/revisions"}],"predecessor-version":[{"id":2397,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/860\/revisions\/2397"}],"wp:attachment":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/media?parent=860"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_category?post=860"},{"taxonomy":"glossaries","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/glossaries?post=860"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_tag?post=860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}