{"id":922,"date":"2024-05-07T11:45:41","date_gmt":"2024-05-07T11:45:41","guid":{"rendered":"https:\/\/kb.shortpixel.com\/docs\/why-sometimes-shortpixel-cannot-optimize-images-on-staging-websites\/"},"modified":"2025-08-27T08:40:15","modified_gmt":"2025-08-27T08:40:15","password":"","slug":"why-sometimes-shortpixel-cannot-optimize-images-on-staging-websites","status":"publish","type":"docs","link":"https:\/\/kb.shortpixel.com\/knowledge-base\/article\/why-sometimes-shortpixel-cannot-optimize-images-on-staging-websites\/","title":{"rendered":"Why sometimes ShortPixel cannot optimize images on staging websites?"},"content":{"rendered":"\n<p>We noticed that on some staging websites the URLs of the images in the Media Library and in the database are pointing to different URLs. For example, instead of<br><code>https:\/\/staging-website.example.com\/path\/to\/image.jpg<\/code>, the images would point to <code>https:\/\/example.com\/path\/to\/image.jpg<\/code>.<\/p>\n\n\n\n<p>While the images can be seen when a customer navigates the website or the dashboard, the URLs for the staging website can confuse <a href=\"https:\/\/wordpress.org\/plugins\/shortpixel-image-optimiser\/\" target=\"_blank\" rel=\"noopener\">ShortPixel Image Optimizer<\/a>.<\/p>\n\n\n\n<p>A solution to this problem is usually to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to your WordPress\u00a0dashboard, navigate to <strong>Settings <\/strong>> <strong>General<\/strong><em>,<\/em> and there make sure the <strong>WordPress Address (URL)<\/strong> and <strong>Site Address (URL)<\/strong> are correct.<\/li>\n\n\n\n<li>Refresh\/flush the permalinks by navigating to <strong>Settings <\/strong>> <strong>Permalinks <\/strong>and clicking the <strong>Save Changes <\/strong>button.\u00a0<\/li>\n<\/ul>\n\n\n\n<p>On some staging websites, these settings are those of the live site and not of the staging website and this can lead to errors when trying to optimize the images with ShortPixel.<\/p>\n\n\n\n<p>Another possible solution to this is to just run ShortPixel on the live site as it should work just fine. Lastly, there is also the option to\u00a0test the ShortPixel plugins on a <a href=\"https:\/\/shortpixel.com\/knowledge-base\/article\/is-there-a-way-to-test-shortpixel-plugins-on-a-sandbox-system\/\" rel=\"noopener\">sandbox system<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We noticed that on some staging websites the URLs of the images in the Media Library and in the database are pointing to different URLs. For example, instead ofhttps:\/\/staging-website.example.com\/path\/to\/image.jpg, the images would point to https:\/\/example.com\/path\/to\/image.jpg. While the images can be seen when a customer navigates the website or the dashboard, the URLs for the staging [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[37],"glossaries":[],"doc_tag":[],"class_list":["post-922","docs","type-docs","status-publish","hentry","doc_category-shortpixel-image-optimizer"],"blocksy_meta":[],"year_month":"2026-04","word_count":187,"total_views":"662","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 Image Optimizer","term_url":"https:\/\/kb.shortpixel.com\/knowledge-base\/category\/shortpixel-image-optimizer\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/922","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=922"}],"version-history":[{"count":1,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/922\/revisions"}],"predecessor-version":[{"id":1408,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/922\/revisions\/1408"}],"wp:attachment":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/media?parent=922"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_category?post=922"},{"taxonomy":"glossaries","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/glossaries?post=922"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_tag?post=922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}