WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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
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
up vote 2 down vote accepted

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:


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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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