I like to have folders in my theme folder for scripts and styles, but I can't access these folders in the "Edit Themes" interface. This is problematic for clients that don't give me FTP access. Is there a way to see these folders and the files in them from the Wordpress admin section?

  • 1
    Why do you must use the theme editor from WordPress? You easily can create a custom page for showing such files, and add a visual editor (whatever you want) to that for coding as you like.
    – grosshat
    Nov 16, 2012 at 8:07
  • 4
    Clients who don't give you FTP access are bad clients, or they're giving you better ways such as shell access. Chances are its a social issue because they lack the knowledge to know what FTP is so they're covering their arses. Demand access to the things that you need te be able to do your job, afterall you dont pay a plumber to fix your sink but deny entry to the house
    – Tom J Nowell
    Nov 18, 2012 at 20:55
  • Possible duplicate of: how to make stylesheet appear in theme editor?
    – brasofilo
    Nov 19, 2012 at 23:38
  • 1
    simply add file_put_contents(get_template_directory() .'/template-custom-page.php', 'temporary content'); to an existing template. Visit that page and it will create the file for you (if the web server user can create files). Jul 28, 2016 at 17:55

8 Answers 8


There is not a way to do this without modifying the core.

You should see .php files that are in subdirectories, but you won't see anything above the root theme directory for .css files, and you won't see any JavaScript files.

If you take a look at wp-admin/theme-editor.php, the relevant lines are...

$allowed_files = $theme->get_files( 'php', 1 );
$has_templates = ! empty( $allowed_files );
$style_files = $theme->get_files( 'css' );
$allowed_files['style.css'] = $style_files['style.css'];
$allowed_files += $style_files;

$theme is is a WP_Theme object representing the current theme. It's create a few lines above.

The get_files method searches a directory by matching the the file extension (first argument) and using the depth (second argument). The first call to get_files fetches all PHP files in the theme directory as well as the any subdirectories one level above the theme directory.

The second fetches all css files in the theme directory but it doesn't recursively go into subdirectories (notice the lack of the $depth argument).

There's not much you can do about this; there is a conspicuous lack of any calls to apply_filters and do_action in theme-editor.php and the get_files method lacks them as well. You're pretty limited.

And when PHP doesn't work, time to try the ugly JavaScript hacks!

Unfortunately, that's no good either. I tried exploring adding files to the list via JavaScript and ajax, but clicking on a JS added file results in an error message due to function called validate_file_to_edit which checks the current file to edit against the list of $allowed_files (see the above code that fetches that).


The Advanced Code Editor plugin provides this functionality.

From the plugin description:

Enables syntax highlighting in the integrated themes and plugins source code editors. Supports PHP, HTML, CSS and JS.
Effectively edit your themes or plugins when you only have access to a browser, by enabling syntax highlighting in WordPress integrated source code editors. Supports PHP, HTML, CSS and JavaScript

Edit: The plugin mentioned above doesn't seem to have the directory tree for themes; only plugins. There is, however, another plugin that does provide this functionallity: WPide

From the plugin description:

File tree allowing you to access and edit any file in your wp-content folder (plugins, themes, uploads etc)

There has also been a trac ticket on this topic; hopefully this will be fixed in a future version of WordPress.

  • That's still not what he's looking for - this plugin only changes the appearance of the editor and indeed adds some pretty cool features to it, but it still doesn't let him edit all of the files found within his theme directory(which the actual problem is) Nov 19, 2012 at 16:02
  • There should be a directory tree to the right of the page... you can access all css, js, html and php files there
    – shea
    Nov 19, 2012 at 19:10
  • Wow, cool plugin and it is from a WPSE fellow: @bainternet :)
    – brasofilo
    Nov 19, 2012 at 23:43
  • 1
    But @NikolaIvanovNikolov is right, no sub-folder editing for themes. The plugins editor does have it, but so does a plain installation. ..... Nikola, it seems that there's really no solution for that, apart from hacing the cre or creating a custom options page to handle custom CSS (if that was the case).
    – brasofilo
    Nov 20, 2012 at 0:07
  • 1
    The WPide plugin seems to support a directory tree for themes.
    – shea
    Nov 20, 2012 at 3:53

I do the same thing as you and organize things in folders. I never use that editor but I just took a look at one of my sites and I can see the files but not the directories. That is, the files are listed as present and are editable, but they are not displayed by directory. You can't tell what folder they are in unless you read the URL for the links.

If you are talking about a child theme, I am having trouble seeing some of the files and I don't know why. The owner, group, and permissions match on the parent theme, whose files I can see, and the child theme, some of whose files I can't see. I'd never noticed the issue until this question came up.

  • I don't see any files that are in a directory at all! e.g. in my css/ folder, I have 'style.css', 'style-med.css', and 'style-mobile.css'. None of these are visible from the "Edit Themes" page :(
    – Voriki
    Nov 11, 2012 at 22:33
  • I verified my answer by checking another site on a different server. However, on a third site I am having trouble seeing some of the files for a child theme but not the parent theme. Would that be related to your case?
    – s_ha_dum
    Nov 11, 2012 at 22:57

This is not a problem for all users.

Therefore, update to WordPress 3.4.x if you haven't already.

Remember that css/style.css will alphabetically appear under 'c', but separated out under Styles at the bottom.

If this doesn't work, try the same theme on a localhost install - if it works there it could be that their server doesn't allow recursive listing.


I face the same problem almost every day with our WordPress customers.

I use a plugin that allows you to edit all files of WordPress. But it is not safe for accounts on shared hosting (sometimes plugin allow edit any files on whole server).

This plugin has been removed from wordpress.org (I think for security reasons) and the author's domain now expired. I've found small review here: http://www.themepremium.com/access-ftp-from-wordpress-dashboard-using-myftp-wordpress-plugin/

Below I'll post a link to a copy of the plugin.

NOTE: I haven't any relations to the author of this plugin and have not modified it. I will not be held responsible for how you use the plugin.

"myftp" plugin


If you do not have FTP access but you can use a little hack in the theme editor...

Simply add the following code to an existing template:

@file_put_contents(get_template_directory() .'/template-custom-page.php', 'temp content');

Visit a URL that is using the template where you added the code to create the file and it should create the file for you (assuming the web werver user has permission to create files in the theme folder).

Remove the added code from the 1st template (after the file is create) otherwise the code will always erase the file content when executed.


For those looking for more recent information, AceIDE (forked from the now unmaintained WPide) works pretty well for quick and dirty edits.

Keep in mind that theme and plugin edits will be overwritten by updates, so editing this way is bad practice.


If a client won't or can't give you FTP access then you shouldn't be working for them. You could take the time it would take to hack the core and just find better clients.

  • 2
    Sorry, but, IMO, this is a comment, not an answer.
    – brasofilo
    Nov 21, 2012 at 12:23
  • No worries, I can't comment on other answers otherwise I would have just done that.
    – dmarges
    Nov 21, 2012 at 21:23
  • ouch.. I never learn that... sorry :/
    – brasofilo
    Nov 21, 2012 at 21:32
  • Meh...don't worry about it. It's more of a flaw with the scoring of SO-type sites. When you're below 50 you can't comment on questions or anything like that. In fact, I only commented on this question because anything to do with touching the core files is a huge red flag for me so I had a knee-jerk reaction. Cheers buddy!
    – dmarges
    Nov 23, 2012 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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