Edit code in your browser

code, editor, edit, htaccess, wp-config, php, files · 0 found this helpful

The code editor opens your site's files in tabs, colours the code, and saves them safely. Use it for quick fixes to themes, .htaccess, wp-config.php and other text files. For big changes, work on your computer and upload over SFTP.

Open the editor

Go to Account → Hosting → your site → Files and click a text file's name. You can also go straight to Code editor.

The code editor with a theme file open

The file list on the left starts in your site's folder. Pick another site, or Whole account, from the menu above it. Click a folder to open it and a file to edit it. Each file opens in its own tab.

Find a file fast

Press Ctrl P (⌘ P on a Mac) or click Quick open, then type part of the file's name. Use the arrow keys to choose a file and press Enter to open it. Files you opened recently come first.

Quick open finding a file by name

Quick open skips folders that are rarely edited by hand, such as node_modules, .git and wp-content/uploads. Open those through the file list. The list of names is kept for ten minutes, so if a new file is missing, click Refresh list at the bottom of quick open.

To find text inside files, click Find in files, enter the text and choose a folder. The search runs in the background, so you can keep working. Results usually arrive within a minute and appear in the same panel. Click a result to open the file at the first match.

Save your changes

Press Ctrl S (⌘ S on a Mac) or click Save. The Unsaved label stays in the status bar until the save is confirmed. If a save fails, your changes stay in the editor and the label stays, so try again or copy your work somewhere safe.

The editor keeps each file's character set and line endings, so an older file saved in Western (Latin-1) stays that way. A file that mixes line endings shows mixed in the status bar, and saving it uses one style on every line. If you type a character that set can't hold, such as an emoji, the editor asks whether to save the file as UTF-8 instead.

File What happens when you save
.htaccess, wp-config.php, .user.ini, php.ini You review the change line by line first, because a mistake here can take your site offline
PHP files The editor checks the syntax. If something looks wrong, it shows the line before you save
Any file The version you replaced goes into file history, so you can restore it

If the file changed while you were editing

Someone else, a plugin or an update may save the same file while you have it open. The editor never overwrites that change without asking. Instead it shows both versions side by side.

The conflict dialog comparing two versions
Choice What it does
Use server version Loads the newer file from the server. Press Ctrl Z to bring your changes back
Save mine instead Saves your version over the newer one. The newer one stays in file history
Merge both and save Shows when your changes and the server's touch different lines. Saves a file with both
Keep editing Closes the dialog without saving

Unsaved work is kept on this device

The editor keeps a draft of unsaved changes in your browser. If you close the tab or lose your connection, open the file again and click Restore changes. Drafts stay on the device and browser you used for 7 days, and signing out clears them.

Files that hold passwords, such as wp-config.php and .env, are the exception. Their drafts last only until you close the browser tab, so they are never left on a shared computer.

Settings

Click the sliders button to turn on Wrap long lines, change Text size, or pick Colours. High contrast suits bright rooms and low vision. Your choices are kept in this browser.

Files the editor won't change

File Why
Images, archives, fonts and other non-text files They open in a viewer with a Download button
Text files over 2 MB They open read-only. Edit them on your computer
Files over 5 MB They don't open. Download them instead

If something goes wrong

Symptom Fix
Your site shows a 500 error after a save Open History, restore the previous version, then read the error log
Save is greyed out Nothing has changed since the last save, or your account is read-only
The editor doesn't load Reload the page. Browser extensions that block scripts can stop it
A file is missing from the list Server folders such as mail and etc are hidden. Your site's files are in public_html or the site's own folder

Was this helpful?

Still stuck? Ask us and we'll walk you through it.