Editing Files

There are times when you will need to edit the WordPress files, especially if you want to make changes in your WordPress Theme. WordPress features a built-in editor for editing files from within your browser whilst online: The Theme Editor. You can also edit files copied or stored on your computer, and then upload them to your site using an FTP client.

Before editing any of your WordPress files, check the following:

BACKUP! And Work from Backups 
Work from copies of backup files when possible and/or make sure that you backup your information frequently as you work and make changes. Keep backups in a safe place.
File Permissions 
When working online, you need to set the appropriate file permissions to modify and save them. If you see a note at the bottom of the WordPress Built-in Editor panel that says “If this file was writable you could edit it.”, this means that you need to change the file permissions before you can make any changes.
Use a Text Editor to Edit Files 
To make changes to files outside of the built-in Plugin or Theme Editor, use a text editor. DO NOT USE A WORD PROCESSING PROGRAM. Word processors change the quote marks to characters and may convert other characters, or bring in unwanted code; these changes will cause the file to break. There are also some HTML generator programs that should not be used, for similar reasons.

Using the Theme Editor and Plugin Editor

WordPress contains two built-in editors that allow you to edit Theme files directly from within your browser. They are called theTheme Editor and Plugin Editor.

Access the Theme Editor from the Administration > Appearance > Editor menu.

The Plugin Editor is located at Administration > Plugins > Editor.

To view a file in these editors, click on the file from the right-hand side list.

More information on editing themes is available at Theme Development and Using Themes. You can learn more about editing plugins at Writing a Plugin and Plugin Resources.

Be aware that if the theme you edit is updated, your changes will be overwritten. To better organize your changes and protect them from updates, consider creating a Child Theme in which to keep all your changes.

What Files Can Be Edited?

From within the WordPress Built-in Editor, the following file types may be edited, if writable:

  • HTML
  • PHP
  • CSS
  • .htaccess
  • TXT (and related text-like files such as RTF)

Was this article helpful?

Related Articles

Leave A Comment?