Title: Cant edit a theme
Last modified: August 18, 2016

---

# Cant edit a theme

 *  [xerocool](https://wordpress.org/support/users/xerocool/)
 * (@xerocool)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/)
 * I cant edit a theme in my 1.5. I clicked Theme Editor and all I get is:
 * Sorry, that file cannot be edited.
 * All my files are 777. ?
 * I activated another theme, same message.

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/cant-edit-a-theme/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/cant-edit-a-theme/page/2/?output_format=md)

 *  Thread Starter [xerocool](https://wordpress.org/support/users/xerocool/)
 * (@xerocool)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-213083)
 * I deleted my cookies, cache, etc..still nothing. :\
 *  [UsmanLaw](https://wordpress.org/support/users/usmanlaw/)
 * (@usmanlaw)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-213085)
 * Go to your file manager through your servers control panel and make sure the 
   files are writable.
 *  [feanor](https://wordpress.org/support/users/feanor/)
 * (@feanor)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214112)
 * i just upgraded to version 2.0.4 and now have the same problem with a theme I’ve
   been able to edit in 2.0.4. All the files including the theme directory are 777.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214113)
 * Directory – 777, files should be 666.
    (and because you’ll not change back them
   after every small edit, you’ll leave your blog completely vulnerable for any 
   hacker out there. Don’t use it. Edit the template files on your computer!)
 *  [trasnam](https://wordpress.org/support/users/trasnam/)
 * (@trasnam)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214114)
 * I noticed this is a regression present with 2.0.4 and 2.1 Alpha 2. The theme 
   that was causing a problem has brackets in the directory name(for example, themename[
   modification]), and for some reason upon clicking “Update File,” the brackets
   are stripped out of the $files variable. Because of this, the value for $files
   doesn’t match the value present in $allowed_files and the function validate_file
   returns 3, which in turn results in validate_file_to_edit doing a “die(__(‘Sorry,
   that file cannot be edited.’));”. All of these variables I am referring to are
   in admin-functions.php.
 * I haven’t been able to track down yet where the brackets are stripped out, but
   it has to be something new to 2.0.4 and 2.1 Alpha 2. I tried fresh installs of
   2.0.3, 2.0.4, and 2.1 Alpha 2, and 2.0.3 is the only installation that works 
   properly.
 * As a workaround, I renamed the theme directory to not have any brackets in it.
 * I plan on posting a bug report shortly.
 * feanor, does your theme’s directory happen to have brackets in it, or is my issue
   completely unrelated?
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214115)
 * Maybe having brackets in a directory name is not the wisest thing to do…
 *  [spencerp](https://wordpress.org/support/users/spencerp/)
 * (@spencerp)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214116)
 * There really isn’t much need for brackets in a directory name..!? What’s the 
   point of it anyways..? =/
 * It’s bad enough now, helping people upload their themes properly..sigh.. Brackets
   would just add to the problem even more. [rolls eyes]..people..I tell ya lol!
 * spencerp
 *  [trasnam](https://wordpress.org/support/users/trasnam/)
 * (@trasnam)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214117)
 * Last time I checked, a bracket is a valid text character for use in a file/directory.
   If I have a valid directory name, it should be handled correctly.
 * Previous comments are basically saying parenthesis or underscores shouldn’t be
   handled either since there isn’t “much need” for them. Just because something
   is seldom used does not mean it shouldn’t be handled correctly.
 * Anyways, the bug report is filed.
 * I know it’s somewhat rare to use a bracket, but if WordPress isn’t going to handle
   the use of brackets properly, it should at least prompt the user to rename the
   directory to something that WordPress finds acceptable. If this isn’t the case,
   then it is a bug, plain and simple, and should be addressed.
 *  [trasnam](https://wordpress.org/support/users/trasnam/)
 * (@trasnam)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214118)
 * I posted the bug report to the following page:
 * [http://trac.wordpress.org/ticket/2994](http://trac.wordpress.org/ticket/2994)
 * I later found out where the troublesome code is, which you can see from the above
   link is a section of code in wp-includes/pluggable-functions.php .
 * For those having problems, the easiest fix for now would be to rename the directory
   that is causing the issues. Otherwise, either revert to the 2.0.3 code in pluggable-
   functions.php (as mentioned in the bug ticket link above), or wait until the 
   devs officially fix the problem.
 *  [amykay](https://wordpress.org/support/users/amykay/)
 * (@amykay)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214119)
 * no offense, but moshu and spencerp, maybe you could can the sarcasm and holier-
   than-thou attitude when trying to help some of us in the forums. There are quite
   a few people who are new at this and might not understand _why_ you shouldn’t
   have your files set at 777 or _why_ putting prackets in file names “is not the
   wisest thing to do…”
 * just my two cents.
 *  [feanor](https://wordpress.org/support/users/feanor/)
 * (@feanor)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214120)
 * Trasnam, I know I’m going to sound totally noobish here, but I’m not entirely
   sure what you mean.
 * The theme in question is ChaoticSoul v.1.0 (as displayed in the themes dir). 
   Here’s the odd thing – even after getting the error, when I look at the template
   file I just edited and got the error on, the changes are saved…
 * Let me know where/what to look for and I’ll be happy to provide any information
   I can.
 * Just as a point of reference, the two themes that come default with WP (classic
   and default) both work with no problems.
 * And as a side note, I didn’t leave my dir at 777 🙂 I was just trying to state
   that changing perms didn’t help with the problem.
 *  [trasnam](https://wordpress.org/support/users/trasnam/)
 * (@trasnam)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214121)
 * feanor,
 * Unfortunately this problem not only affects brackets. It affects spaces also (
   among other characters, like parenthesis, for instance).
 * I suggest for now to rename the directory to ChaoticSoul, or ChaoticSoul_v1.0.0
   or the like. It should then work properly.
 * It all comes down to the preg_replace line in wp-includes/pluggable-functions(
   that I mentioned in the bug ticket) that limits what characters are allowed. 
   Apparently this fixes some IIS bug, but messes things up for us.
 *  [feanor](https://wordpress.org/support/users/feanor/)
 * (@feanor)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214122)
 * trasnam – worked like a charm. simple fix (without being a coder, i tend to like
   those the best).
 *  [trasnam](https://wordpress.org/support/users/trasnam/)
 * (@trasnam)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214123)
 * feanor,
 * I’m glad I could help. Who would have thought that something as innocent as a
   space in the directory name would be causing the problem?
 *  [spencerp](https://wordpress.org/support/users/spencerp/)
 * (@spencerp)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/#post-214124)
 * This “fix” *might* make it into the SVN branch/ and trunk/, but..won’t be publically
   accessible per se..unless they add it quick, some how into the downloadable zip
   or tar for 2.0.4. =/ (And of course..the people that know how to grab the SVN
   copies lol..but, it’s cool though. )
 * But, I’ll check out the “fix” or whatever then k. =) See what happens.. =p Congrats
   on taking this upon yourself.. =)
 * spencerp

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/cant-edit-a-theme/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/cant-edit-a-theme/page/2/?output_format=md)

The topic ‘Cant edit a theme’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 21 replies
 * 10 participants
 * Last reply from: [shantanu20](https://wordpress.org/support/users/shantanu20/)
 * Last activity: [19 years, 8 months ago](https://wordpress.org/support/topic/cant-edit-a-theme/page/2/#post-214131)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
