0

If I set the permissions to the CSS file in my theme to 444 and then attempt to edit it in the Appearance Editor, WordPress is not prevented from editing the file and in fact change the permissions to 644 while it makes the edit.

Why does WordPress change a file's permissions?

How do I make the site more secure and prevent this?

  • 4 is read-only. If you set permissions to 4 then WordPress can't write-- that is, edit-- the file. I haven't checked the theory but your description makes it sounds like WordPress is attempting to do what you want and is changing the permissions in order to do so. How do you expect to be able to set the file permissions to read only and still be able to edit them? – s_ha_dum Apr 22 '13 at 21:41
  • That's just it, I don't want to be able to edit those files. – mmcglynn Apr 22 '13 at 21:53
  • 1
    You explicitly state that you "attempt to edit it in the Appearance Editor". Therefore, you are asking WordPress to edit the files. If you want to prevent editing this isn't really the way to do it. Just disable the editor. – s_ha_dum Apr 22 '13 at 21:56
2

Per the link provided in my comment to your question, if you wish to prevent the editing of files by WordPress, just disable the file editor.

To do that add the following to your site's wp-config.php file:

define('DISALLOW_FILE_EDIT',true);

Or to disable the file editor and the plugin and theme installation/update system:

define('DISALLOW_FILE_MODS',true);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.