{"id":832,"date":"2024-05-07T11:44:07","date_gmt":"2024-05-07T11:44:07","guid":{"rendered":"https:\/\/kb.shortpixel.com\/docs\/what-does-this-json-ajax-option-in-your-settings\/"},"modified":"2025-08-27T08:42:11","modified_gmt":"2025-08-27T08:42:11","password":"","slug":"what-does-this-json-ajax-option-in-your-settings","status":"publish","type":"docs","link":"https:\/\/kb.shortpixel.com\/knowledge-base\/article\/what-does-this-json-ajax-option-in-your-settings\/","title":{"rendered":"Settings &#8211; Replace in JSON data"},"content":{"rendered":"<p>\n\t ShortPixel Adaptive Images has an option called &#8220;Replace in JSON data&#8221;, which is located on Settings &gt; ShortPixel AI &gt; Areas. Although useful, it can be confusing. To explain what it is and to know if you should activate it, keep reading.<\/p>\n<p>\n\t <img decoding=\"async\" src=\"https:\/\/kb.shortpixel.com\/wp-content\/uploads\/2025\/08\/file-v6gNYvmjln.jpg\" style=\"width: 659px;\"><\/p>\n<p>\n\t Some plugins make&nbsp;JSON AJAX calls. These are calls made by the JavaScript code of, say, a slider, to the WordPress back-end to get some data. Then, the requested data comes back in this special serialized form called <strong>JSON, <\/strong>which it&#8217;s called JSON metadata.&nbsp;This metadata can contain URLs of images, therefore the first option (&#8220;Also parse JSON AJAX calls to replace image URLs&#8221;) <a href=\"https:\/\/help.shortpixel.com\/article\/132-how-shortpixel-adaptive-images-work\" target=\"_blank\" rel=\"noopener\">will replace such URLs<\/a> without knowing where or how they will be displayed, hence ShortPixel won&#8217;t be able to resize them appropriately.<\/p>\n<p>\n\t If the second option is activated (&#8220;Lazy-load JSON URLs&#8221;), the URLs will be replaced by lazy-loaded URLs which will then be caught by ShortPixel&#8217;s front-end JavaScript (when the JavaScript of the slider for example is modifying the DOM to put the new URLs in place) and <strong>scaled accordingly<\/strong>.<\/p>\n<p>\t That&#8217;s a lot of technical info we reckon. \ud83d\ude42 So it basically boils down to this:&nbsp;<\/p>\n<ol>\n<li><strong>If your site uses JSON AJAX calls, activate both options and save the changes<\/strong>.<\/li>\n<li><strong>Deactivate &#8220;Lazy-load JSON URLs&#8221; if images disappear,&nbsp;<\/strong>because maybe our JavaScript doesn&#8217;t properly catch the other JavaScript when it does its job.<\/li>\n<li><strong>Deactivate &#8220;Also parse JSON AJAX calls to replace image URLs&#8221; as well if you still have missing images<\/strong>.<\/li>\n<\/ol>\n<p>\n\t When testing, load the first page twice; in some cases the images could not display properly at first load (sitewide).<\/p>\n<p>\n\t <strong>How to detect if your site uses JSON AJAX calls that need to be parsed<\/strong>: Open the Developer tools of your browser (by pressing F12 on Windows\/Linux or Cmd+Alt+&#8217; on MacOS), switch to Network tab, select the XHR sub-tab, then reload the page and look through each call in the list. If any of the answers start with &#8220;<strong>{<\/strong>&#8221; or with &#8220;<strong>[<\/strong>&#8220;, that&#8217;s an AJAX call. If then any of those contains URLs with your domain like &#8220;https:\/\/example.com\/&#8230;&#8221;,&nbsp;then you can benefit from this JSON AJAX parsing.<\/p>\n<p>\n\t <img decoding=\"async\" src=\"https:\/\/kb.shortpixel.com\/wp-content\/uploads\/2025\/08\/file-HjCR19uyTL.png\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ShortPixel Adaptive Images has an option called &#8220;Replace in JSON data&#8221;, which is located on Settings &gt; ShortPixel AI &gt; Areas. Although useful, it can be confusing. To explain what it is and to know if you should activate it, keep reading. Some plugins make&nbsp;JSON AJAX calls. These are calls made by the JavaScript code [&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-832","docs","type-docs","status-publish","hentry","doc_category-shortpixel-adaptive-images"],"blocksy_meta":[],"year_month":"2026-04","word_count":361,"total_views":"1132","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\/832","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=832"}],"version-history":[{"count":1,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/832\/revisions"}],"predecessor-version":[{"id":2424,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/832\/revisions\/2424"}],"wp:attachment":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/media?parent=832"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_category?post=832"},{"taxonomy":"glossaries","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/glossaries?post=832"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_tag?post=832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}