So you’ve uploaded a WordPress theme, head on over to the theme editor to make some changes, and get the dreaded If this file were writable you could edit it message? Not to worry, this is a quick fix. You don’t have to fire up your FTP client and reupload a new template file every time you make a change. You can use the theme editor like everyone else, with just a few quick changes to your file permissions, and I’ll show you how.

  • What exactly are file permissions, and what do I need to set them to?
  • How to change file permissions via an FTP client (in bulk)
  • How to change file permissions via cPanel

Let’s read on…

What are file permissions?

This is a method of administering access rights to certain files of your site. There are 3 types of permissions, read, write, and execute. Each of these types can be defined per a certain user group. These include owner permissions, group permissions, and public permissions. Some host’s security settings do not have the ideal WordPress permissions set by default, you’ll have to add this yourself. You don’t need to worry about all these technical details. All you need to remember is the number: 666.

Changing file permissions in FTP

This is probably the quickest way of changing the file permissions for all of your template files in one swift command. Open up your favorite FTP client, navigate to your template directory (with style.css, index.php, etc.) and select all .php and .css files. Do not select images or subdirectories.

WordPress FTP File Attributes

You can press CTRL + A to select them all, and click while holding CTRL to deselect items like images. After selecting the File Attributes option from the menu, you can change all the permissions to 666. You’ll notice the the group and public write permissions will automatically checked off.

WordPress FTP Change File Attributes

After pressing OK all the permissions to the files you selected should be changed to -rw-rw-rw-. You should now be able to edit them via the theme editor.

Changing permissions in cPanel

You can also do this in cPanel, although not in bulk (for the version of cPanel I’m using anyway). Open up the file manager, navigate to the template directory (similar to FTP) and click on the file you want to change permissions for.

WordPress cPanel File Manager Permissions

Change each one to 666, as before. This could be useful if you don’t have access to an FTP client, or just want to selectively make files writable.

Conclusion

If you can already edit themes in the theme editor, and your files are still set to 644, don’t worry about this tutorial. If it works, it works - no reason to change it. Some hosts may differ depending on their server configurations.

You may see different sources telling you to set everything to 777, which gives everybody full permissions. I wouldn’t recommend this. Although it would work, it may open up security holes on your site. The 666 permissions are just enough for the text files you’ll be editing.

Hope you enjoyed the article. Feel free to comment and share if you liked it.

Subscribe to RSS

By: Leland on Apr. 11

Bookmark and Share

25 Comments »

Comment by Ray
2008-04-11 09:14:39

Setting the permissions to 666 (-rw-rw-rw-) gives write access to any other users that share your web server (assuming you’re in a shared hosting environment). Is it really necessary to have the theme files writable by the world? Wouldn’t a permissions setting of 664 (-rw-rw-r–) be a little safer?

 
2008-04-12 15:28:38

Well the degree of access is important, but the main thing is you wrote this post. I searched for an answer like this for months!

 
Comment by Leland
2008-04-13 15:46:46

Ray, you’re right. It may be better to start with 664 to see if that works before trying 666.

Dave, glad you found it useful.

 
Comment by Billy Subscribed to comments via email
2008-04-24 04:35:35

Great info. But what I REALLY need to know is how to make the permissions DEFAULT to 766 for new files. I use the ProSense theme and when I ftp them up they default to 644. This means that I have to use my ftp client to change the permissions before I can edit adsense information. Doing many sites per day, this becomes a very tedious step. If I could have new directories default to 755 and new files default to 766 it would save me a lot of time!
Thanks in advance!

 
Comment by Cliff Calderwood
2008-05-03 21:13:17

Thank you for posting this tutorial on explaining what to do to get the permissions fixed so I could edit my new theme. I was going crazy until I found it and spent most day trying to figure out what permissions wordpress needed so I could use the built in editor.

Cliff

 
Comment by Andie Summerkiss
2008-05-06 11:20:05

Hi, I have one question though. After we change the permission and anything, how to proceed from there? Do we upload another edited files or we change it directly at the theme editor? Can anybody give me some pointers? I have been looking for it all day.

 
Comment by Andie Summerkiss
2008-05-06 11:38:52

Sorry. I got it already. That was explained on the first paragraph of the post.

Thank you for the life-saving tip. That just saved me from a couple of nights’ worth of sleep.

 
Comment by livelynotebook
2008-07-12 12:52:08

Yeah, you’re rock!! I found something here. Thank you.

 
Comment by Terry of Astoria
2008-07-31 02:45:29

You should change back the permissions to 644 for files and 755 for dirs, after editing the files. Really. Read up on the wp codex,
here!

 
Comment by dips Subscribed to comments via email
2008-11-18 13:52:35

Open up your favorite FTP client, navigate to your template directory (with style.css, index.php, etc.) and select all .php and .css files. Do not select images or subdirectories.???
i dont knw how to do this?? :(
i just made a wordpress blog and i cant see a plugin option on it all i know is i need a writable theme file for it.. but i just dont know hw can i do this damn thing?? please help me..send me a mail if possible..

 
Comment by Snoop
2008-12-20 09:36:38

Thanks, man!

 
2009-02-16 07:51:31

great… it worked … TY!

 
Comment by Thewirds
2009-02-18 12:53:20

Hi
i try your tips here but i got this result in my FTP client

500 ‘SITE CHMOD 666 wp-content’: command not understood

I change 666 to 664 or 644 it doesn’t works either

i’m using filezilla also i don find that option in my database to change the permission, any help please??

 
Comment by Albert Subscribed to comments via email
2009-02-28 09:50:19

Really helpful. This will not needed for bis hosts. But in some cases we have to do manually.

Thanks for sharing.

 
Comment by Kerry
2009-03-25 10:38:17

Thanks so much for your tutorial! You made it very easy, and it fixed my issue.

 
Comment by Matt
2009-04-26 05:49:22

I change it to 644, but I still can’t edit the file

what to do?

 
Comment by Jen
2009-04-27 15:26:50

Thank you! Exactly what I needed!

 
Comment by Liz
2009-05-11 12:00:00

THANK YOU SO MUCH FOR THIS! The instructions on wordpress are not nearly as understandable as this!

 
Comment by fakhrul
2009-06-18 03:22:49

seriously, ur entry VERY HELPFUL!!

THANK YOU SO MUCH.!!!

MUAH.
hehe

 
Name (required)
E-mail (required - never shown publicly)
URI
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

Trackback responses to this post

Recent Comments

  • Anto: Hello. Thanks, you’ve got my contact details. Get in touch with me if your wanting something in your own...
  • Sonny: Hey Anto, I love this design, good work that I paid for link removal :) Anyways, how can one contact you to do...
  • Leland: @axelk: As in picture uploads? Not sure about that, although you could set up the form to allow users to send...
  • axelk: thank you for the reply. can Contact 7 be used to submit pictures as well?
  • Leland: @axelk: I think that’s what the Contact Form 7 is for. Although if you wanted to allow users to submit...

About The Author

Welcome to Theme Lab. My name is Leland, and I run the place. I write all the tutorials and code all the themes you see here on the site.

For more information about me, feel free to read the about page. If you want to drop me a message, feel free to contact me.

Interested in advertising on Theme Lab? We have advertising available at very reasonable rates. Head on over to the advertising page for further details.

Please read our Privacy Policy and Terms of Service in regards to theme usage.

© 2009 - Theme Lab - Powered by WordPress