Instant Access Internet Services customers can edit a file in cPanel File Manager right in the browser - no FTP program or download needed. This is the quickest way to make a small change to .htaccess, wp-config.php, an HTML page or a PHP file. This guide walks you through opening the editor, saving your changes and backing up first so a mistake is easy to undo.
Before you start: make a backup copy
A typo in a configuration file can break your website. Take ten seconds to make a copy before you edit:
- In cPanel, go to Files > File Manager.
- Browse to the file, click it once to select it, then click Copy in the toolbar.
- In the path box, add a new name at the end, for example
/public_html/wp-config-backup.php, and click Copy File(s).
If your edit goes wrong, you can delete the broken file and rename the copy back to the original name.
Looking for .htaccess and can't see it? It's a hidden file - see How to Show Hidden Files (.htaccess) in cPanel File Manager to turn on hidden files first.
How to edit a file in cPanel File Manager
- In cPanel, go to Files > File Manager.
- Open the folder that contains the file (your website's files are in
public_html). - Click the file once to select it, then click Edit in the toolbar. You can also right-click the file and choose Edit.
- A window may ask you to confirm the file's character encoding. Leave the detected encoding (normally utf-8) and click Edit.
- The file opens in the editor in a new browser tab. Make your changes.
- Click Save Changes in the top-right corner of the editor.
- Click Close to return to File Manager, then test your website in another tab.
The editor is a plain code editor with line numbers and colour highlighting. It saves exactly what you type, which is what you want for configuration and code files.
Edit vs. HTML Editor
When you right-click an .html file you may also see HTML Editor (Beta). This is an experimental visual editor. It can rewrite parts of your page's code when it saves, so for most changes we recommend the regular Edit option. If you do use the HTML editor, make a copy of the file first.
Tips for editing common files
- .htaccess - rules are read from top to bottom. Add new rules on their own lines and don't remove the
# BEGIN WordPress/# END WordPressblock on a WordPress site. - wp-config.php - add custom lines above the line that says
/* That's all, stop editing! */. Don't leave stray spaces or blank lines before the opening<?php. - PHP files - one missing semicolon or bracket can cause a blank page or "500" error. Undo your last change if the page stops loading.
- Theme and plugin files - changes you make are overwritten the next time that theme or plugin updates. Use a child theme or a code-snippets plugin for lasting changes.
Troubleshooting
The Edit button is greyed out
Some actions only work on one file at a time. Make sure exactly one file is selected (not a folder, and not several files).
The file is too large to edit
File Manager can only edit files up to 1 MB. For larger files, click Download, edit the file on your computer with a text editor (such as Notepad++ or VS Code), then upload it back with Upload. Or use FileZilla - see How to Connect to Your Website with FileZilla (FTPS).
The file shows strange symbols
The wrong character encoding was selected. Click Close without saving, then open the file again and choose the correct encoding (almost always utf-8). Saving with the wrong encoding can corrupt the file.
My site shows a 500 error after I saved
Open the file again and undo your last change, or restore the backup copy you made. If you didn't make one, you can restore the file from an automatic backup with How to Restore a File or Folder with JetBackup 5. Your error log can also point to the exact line - see How to Check Your Website Error Log and Recent Visitors.
I saved but the website still looks the same
You may be seeing a cached copy. Clear your browser cache, and if you use WordPress, purge the LiteSpeed Cache (see How to Speed Up WordPress with LiteSpeed Cache). Also double-check you edited the file in the right folder.
Related guides
- How to Use cPanel File Manager to Manage Your Website Files
- How to Show Hidden Files (.htaccess) in cPanel File Manager
- How to Upload and Extract a ZIP File in cPanel
- How to Restore a File or Folder with JetBackup 5
- How to Check Your Website Error Log and Recent Visitors
Still stuck? Open a support ticket and the Instant Access Internet Services team will help.
