{"id":797,"date":"2024-05-07T11:43:30","date_gmt":"2024-05-07T11:43:30","guid":{"rendered":"https:\/\/kb.shortpixel.com\/docs\/why-the-plugin-cannot-overwrite-a-file-what-are-the-necessary-permissions\/"},"modified":"2025-08-27T08:43:00","modified_gmt":"2025-08-27T08:43:00","password":"","slug":"why-the-plugin-cannot-overwrite-a-file-what-are-the-necessary-permissions","status":"publish","type":"docs","link":"https:\/\/kb.shortpixel.com\/knowledge-base\/article\/why-the-plugin-cannot-overwrite-a-file-what-are-the-necessary-permissions\/","title":{"rendered":"Why can&#8217;t the plugin overwrite a file or create a backup? What are the necessary permissions?"},"content":{"rendered":"\n<p>The Unix systems (this includes Linux in all its flavors and distributions) have<em> permissions<\/em> and <em>ownership<\/em> for each file&nbsp;(read more <a href=\"https:\/\/www.linux.com\/learn\/understanding-linux-file-permissions\" target=\"_blank\" rel=\"noopener\">here<\/a>).<\/p>\n\n\n\n<p>We have often seen that when a website is moved from one hosting provider to another that uses Linux (most of the market), the permissions are correct but the ownership of a file is not correctly preserved, or vice versa. For example, a file will have the correct write permissions, but the file owner will be <code>guest<\/code> instead of <code>www-data<\/code>, meaning that if you use a plugin such as <a href=\"https:\/\/wordpress.org\/plugins\/enable-media-replace\/\" rel=\"noopener\">Enable Media Replace<\/a> or <a href=\"https:\/\/wordpress.org\/plugins\/shortpixel-image-optimiser\/\" rel=\"noopener\">ShortPixel Image Optimizer<\/a>, your attempt to replace or optimize a file will fail.<\/p>\n\n\n\n<p><strong>Contact your hosting provider<\/strong> after moving a website from one host to another and make sure that<strong> all <\/strong>your files have both <a href=\"https:\/\/wordpress.org\/support\/article\/changing-file-permissions\/\" target=\"_blank\" rel=\"noopener\">the correct ownership and permissions<\/a>. Once this is sorted out, you should be able to replace files using plugins like the ones mentioned above.<\/p>\n\n\n\n<section class=\"callout-blue\"><strong>Note<\/strong>: The correct permissions for WordPress are 644 for files, and 755 for directories.<\/section>\n","protected":false},"excerpt":{"rendered":"<p>The Unix systems (this includes Linux in all its flavors and distributions) have permissions and ownership for each file&nbsp;(read more here). We have often seen that when a website is moved from one hosting provider to another that uses Linux (most of the market), the permissions are correct but the ownership of a file is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[39,40,37],"glossaries":[],"doc_tag":[],"class_list":["post-797","docs","type-docs","status-publish","hentry","doc_category-enable-media-replace","doc_category-regenerate-thumbnails-advanced","doc_category-shortpixel-image-optimizer"],"blocksy_meta":[],"year_month":"2026-04","word_count":167,"total_views":"824","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\/"},{"term_name":"reGenerate Thumbnails Advanced","term_url":"https:\/\/kb.shortpixel.com\/knowledge-base\/category\/regenerate-thumbnails-advanced\/"},{"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\/797","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=797"}],"version-history":[{"count":1,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/797\/revisions"}],"predecessor-version":[{"id":1612,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/797\/revisions\/1612"}],"wp:attachment":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/media?parent=797"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_category?post=797"},{"taxonomy":"glossaries","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/glossaries?post=797"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_tag?post=797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}