cPanel File Manager includes a built-in text editor that lets you edit files directly on the server without needing to download and re-upload them. This is useful for making quick changes to configuration files, PHP scripts, HTML pages, and more. This guide covers how to use the editor safely.
Opening a File in the Editor
- Log in to your cPanel account.
- Go to Files → File Manager.
- Navigate to the directory containing the file you want to edit.
- Click on the file name once to select it.
- Click Edit from the toolbar at the top, or right-click the file and choose Edit.
- A dialog box will appear asking you to confirm the character encoding. Leave it set to utf-8 unless your file uses a different encoding.
- Click Edit to open the file in the editor.
Using the HTML Editor
For HTML files, you can use the built-in HTML Editor which provides a visual editing experience:
- Select the HTML file and click HTML Editor instead of Edit.
- Choose the character encoding and click Edit.
- The HTML Editor provides a WYSIWYG (What You See Is What You Get) interface where you can format text, insert links, add images, and more.
Making and Saving Changes
- Edit the file content directly in the editor window.
- The toolbar at the top of the editor includes options for:
- Search: Find text within the file.
- Go to Line: Jump to a specific line number.
- Undo / Redo: Reverse or reapply changes.
- Wrap text: Toggle text wrapping for long lines.
- When you are finished, click Save Changes in the top-right corner.
- A confirmation message will appear at the bottom of the page.
- Click Close to return to File Manager.
Editing Hidden Files
Files starting with a dot (like .htaccess) are hidden by default in File Manager:
- In File Manager, click Settings in the top-right corner.
- Check the box for Show Hidden Files (dotfiles).
- Click Save.
- Your hidden files will now be visible and editable.
Common Files You May Need to Edit
.htaccess— Apache server configuration for redirects, rewrites, and security rules.wp-config.php— WordPress database and configuration settings.php.ini— PHP configuration (if a local copy exists in your account).index.html/index.php— Your website homepage.robots.txt— Search engine crawling instructions.
Important Notes
- You cannot edit files larger than 1 MB through the cPanel editor. For larger files, download them and use a local editor.
- Always back up a file before editing it. You can copy the file to a backup name (e.g.,
.htaccess-backup) before making changes. - Choosing the wrong character encoding can corrupt your file. If the file displays as garbled characters, do not save — close the editor and try again with the correct encoding.
- Changes take effect immediately after saving. Be careful when editing live files.
Troubleshooting
"Edit" button is grayed out:
- Make sure you have clicked on the file name (not the checkbox) to select it.
- Some file types cannot be edited this way. Try downloading and editing locally instead.
File appears garbled after opening:
- The wrong character encoding was selected. Close the editor without saving and reopen with the correct encoding.
- If the file is a binary file (images, compiled files), it cannot be edited as text.
Changes are not appearing on the website:
- Clear your browser cache and reload.
- If using Cloudflare or a CDN, purge the cache.
- Verify you edited the correct file in the correct directory.