Why Can’t I Edit My Theme? Using CHMOD to Set File Permissions

One of the questions we get most often is how to enable WordPress to edit theme files using the built-in theme editor. By default, when you upload a theme, the files aren’t writable from the WordPress interface. This is based on the sensible assumption that, generally speaking, visitors to your website shouldn’t be able to edit the files on it. If you’re the administrator of your WordPress site, though, it’s very useful to use the built-in theme editor.

To make your theme files writable, you need to set the permissions on the theme files so WordPress can edit them. This process is also known as CHMOD, short for CHange MODe, which is a UNIX/Linux command (which you probably don’t need to worry about).

To change the permissions of the files on your site, the way you’d open a folder on your computer, you need an FTP application, which is a separate program that connects to the web server to let you upload, download, move, or rename files.

You can download an FTP program such as the following:
Smart FTP
CuteFTP
FireFTP (a Firefox extension, which may be the easiest if you use the Firefox browser; will not work if you don’t)

After installing one of these programs or another FTP application (there are tons available for free), login to your site via FTP. You’ll need three pieces of information:
FTP server - probably ftp.yourdomainname.com
Username - probably the same as your account webhosting account username
Password -probably the same as your account webhosting account password

Note that the username and password will not ordinarily be the same as your WordPress username and password.

Your files are probably within a folder called public_html, httpdocs, html or something along those lines. From there, the themes will be in /wp-content/themes/, and each theme is in its own folder.

Navigate to the folder containing your theme. Then, highlight all of the files in this folder and right-click on them. There should be an option on the FTP program’s right-click (context) menu called “CHMOD” or “Permissions.”

The permissions settings specify what can be done with a file, and by whom. They’re represented by numbers or checkboxes that give read/write/execute permissions for each file to various groups, e.g. website visitors, you (the FTP user), or the server administrator.

If the files are set to 000, only the server administrator will be able to access them. By default, most files uploaded via FTP are set to 755 or something similar, which means that WordPress can run because anyone can “execute” the file (that is, access the script). However, since WordPress is not considered a user, it’s a member of the “public” group, so by default it can’t write to files.

If you set the theme files to 777 (so everyone has “write” permissions as well as read and execute permissions), that will let you edit your theme from within WordPress. If your FTP program uses checkboxes instead of numbers for file permissions, just check all of them. If you change themes later, just re-do this for the new theme’s files. You could do this for all your files without any problem, but it would take a while, and it’s not really necessary.

Note that if you make an edit to a file that introduces an error that takes down your site, you might need to upload a fresh copy of the theme via FTP, so it’s best not to edit PHP portions of your theme unless you have a backup of the theme file or are comfortable editing PHP. The functions.php file should not be edited from within WordPress, as an error can take down the WP admin panel as well as the public site, and you’d need to fix the error via FTP.

This procedure will work for plugins as well using the built-in plugin editor, but editing plugins is much more likely to crash WordPress, so we do not recommend using the plugin editor. Most plugins have an options page now, and don’t require any editing. if you need to edit a file, use a text editor on your computer and upload the changed file via FTP. If you get an error, simply delete the file, fix the error, and upload it again.

To summarize:

  1. Download and install an FTP application
  2. Login to your site via FTP
  3. Navigate to the theme folder
  4. Select all the files, and right-click on them, and select “Permissions” or “CHMOD”
  5. Check all of the boxes or set the permissions to 777
  6. Visit Presentation -> Theme Editor in WordPress to edit your theme files

Hate Your Host?

Lorelle, the consummate WordPress blogger, wants to know what you look for in a WordPress host. She hates hers, and is shopping around.

What do you look for?

 

Home | Blog | Blog Network

WebbleYou is not affiliated with WordPress, which is freely available under the GPL

Close
E-mail It