{"id":884,"date":"2024-05-07T11:45:01","date_gmt":"2024-05-07T11:45:01","guid":{"rendered":"https:\/\/kb.shortpixel.com\/docs\/enable-media-replace-is-removing-the-original-files\/"},"modified":"2025-08-27T08:41:18","modified_gmt":"2025-08-27T08:41:18","password":"","slug":"enable-media-replace-is-removing-the-original-files","status":"publish","type":"docs","link":"https:\/\/kb.shortpixel.com\/knowledge-base\/article\/enable-media-replace-is-removing-the-original-files\/","title":{"rendered":"Enable Media Replace is removing the original files!"},"content":{"rendered":"<p>Enable Media Replace was designed to easily replace your media files, since this is a functionality that is very demanded. If you notice that your original files are removed when the image is replaced, there are two reasons for that.<\/p>\n<h2>There&#8217;s no backup functionality<\/h2>\n<p>This is an expected behaviour. It may seem obvious, but our little plugin was built to simply replace your files. <strong>It does not save the previous image in a backup file<\/strong>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/kb.shortpixel.com\/wp-content\/uploads\/2025\/08\/file-sMvKTSJWeK.jpg\"><\/p>\n<h2>It does not know if there are &#8220;other&#8221; originals<\/h2>\n<p>Enable Media Replace only sees the images that are present in your Media Library. If some specific image was previously converted or edited, and its original version is kept in a backup in a separate location, Enable Media Replace will not know about that.&nbsp;This can cause all sort of issues, including the removal of the &#8220;other&#8221; originals, and to illustrate this, see the next example with&nbsp;<a href=\"https:\/\/wordpress.org\/plugins\/shortpixel-image-optimiser\/\" target=\"_blank\" rel=\"noopener\">ShortPixel Image Optimizer<\/a>.<\/p>\n<h3>Example<\/h3>\n<p>Imagine the following situation:<\/p>\n<ol>\n<li>You upload a PNG image<\/li>\n<li>Let it optimize with ShortPixel Image Optimizer (SPIO)<\/li>\n<li>At the same time, convert it to JPG with ShortPixel as well.<\/li>\n<li>ShortPixel&#8217;s backup folder will contain the original PNG<\/li>\n<li>The Media Library will have the optimized and converted JPG<\/li>\n<\/ol>\n<p>Since Enable Media Replace doesn&#8217;t know that the file was originally a PNG, <strong>if you use the option &#8220;Just replace the file<\/strong><strong>&#8220;<\/strong>, the following situation can happen:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/kb.shortpixel.com\/wp-content\/uploads\/2025\/08\/file-gN6CT0r18H.jpg\"><\/p>\n<ol>\n<li>You try to replace your file with a new PNG (remember, on WordPress we have a JPG converted from a PNG) with the option &#8220;Just replace the file&#8221;.<\/li>\n<li>Your new file will still be a JPG, but in reality it is a PNG. That results in a corrupted file.<\/li>\n<li>ShortPixel Image Optimizer removes all backups when the image is replaced, which is intended behaviour. That means the original pre-replacement PNG backup will be removed.<\/li>\n<li>ShortPixel will optimize the file and save as a new backup the corrupted JPG.<\/li>\n<\/ol>\n<p>The previous situation could&#8217;ve been avoided if the option &#8220;Replace the file, use new file name and update all links&#8221; was used.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Enable Media Replace was designed to easily replace your media files, since this is a functionality that is very demanded. If you notice that your original files are removed when the image is replaced, there are two reasons for that. There&#8217;s no backup functionality This is an expected behaviour. It may seem obvious, but our [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[39],"glossaries":[],"doc_tag":[],"class_list":["post-884","docs","type-docs","status-publish","hentry","doc_category-enable-media-replace"],"blocksy_meta":[],"year_month":"2026-04","word_count":335,"total_views":"2375","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":"Enable Media Replace","term_url":"https:\/\/kb.shortpixel.com\/knowledge-base\/category\/enable-media-replace\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/884","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=884"}],"version-history":[{"count":1,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/884\/revisions"}],"predecessor-version":[{"id":2374,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/884\/revisions\/2374"}],"wp:attachment":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/media?parent=884"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_category?post=884"},{"taxonomy":"glossaries","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/glossaries?post=884"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_tag?post=884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}