WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Manage Files SubPanel

This article may be outdated and contain information pertaining to an older version of WordPress. Please take caution when following the procedure, as many things may have changed.

Contents

Manage → Files

There are many user editable files in a standard WordPress installation. Examples include your theme templates, .htaccess, and my-hacks.php. In this Files SubPanel, these files can be accessed and modified to suit your needs.

Back to Administration Panels.

Built-in File Editor

The Built-in File Editor allows you to view any file, and edit any file which is writeable (see Changing File Permissions). At the bottom of the SubPanel is a box called "Other Files". By entering any file name in the text box here and clicking the "Edit file" button, the Built-in Editor can be used to view/edit that file. The large text box displays the contents of the selected file and allows you to modify those contents.

After editing a file's contents in the large text box, click the "Update File" button to save your changes.

Additionally, the editor provides you with some handy links:

Recent
The five most recent files you have viewed with the Built-in File Editor.
Common
A list of files that are common to your entire blog, no matter the Theme you're using. Files include: .htaccess (see also this section of Introduction to Blogging, the Main Template for your blog (your blog's base index.php which is, by default, nearly empty), and my-hacks.php. This list will also include any legacy theme files from your base directory if you have any.

Some Caveats about the Built-in Editor:

  • To edit a file, the permissions for that file must be set to 666. Use your FTP program to CHMOD 666 any files you wish to edit using the WordPress template editor.
  • Changes you make are instant, and you do not need an ftp program after initially uploading the files and setting permissions.
  • There is no backup: a mis-edit may cost you necessary information.
  • Making a mistake when editing your .htaccess file can take down your site, and with it the WordPress editor. Make sure you have ftp access when editing .htaccess (your rewrite rules) so you can delete the bad file if necessary.

Editing in General

Take note of these file editing tips. They really are useful. Really.

Good Practice

Follow these simple suggestions. They are time savers.

Using the Built-in WordPress editor
  • After you have selected the Template tag and the file you wish to edit, then before making any changes at all, right-click in the text box, choose 'Select All' then choose 'Copy'. Paste the highlighted text into a new text document on your computer then SAVE. That is your backup.
Using some other editor
  • Use your ftp program to download the file you wish to work on.
  • If you will be making significant changes, then once the file is downloaded, COPY it, and work on the copy. That way, if you make any mistakes, you can easily go back to a working file.
  • Upload the file back to your server.
  • Alternately, you can copy and paste from the WP editor into your editor instead of downloading. This gives you the best of both worlds, but remember to make a backup.

Editors

A list of editors people have used. Please note under what category they fall :)

The Good

Recommended editors are:

  • PSPad (Windows - Freeware)
  • BBEdit (Mac - $)
  • Crimson Editor (Windows - Freeware)
  • Good old Windows Notepad
  • Whatever editor you use in linux or unix. No editor war here, please :)

The Bad

Do NOT use these for editing your WordPress files at all. Ever. Really, don't:

  • Microsoft Word
  • ANY word-processor

The Ugly

Use these only if you are very familiar with them:

  • DreamWeaver - it's best to copy from the WP editor, replacing what DreamWeaver puts in new files by default.
  • FrontPage - watch out for extra code inserted by FrontPage, and don't try to use its built-in templates.

Back to Administration Panels.