Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
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
add comment

1 Answer 1

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:

define('DISALLOW_FILE_EDIT',true);

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

define('DISALLOW_FILE_MODS',true);
share|improve this answer
add comment

Your Answer

 
discard

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.