Creating and Editing Files Online
The cPanel File Manager includes a built-in code editor that allows you to create and edit files directly in your browser. This is useful for making quick changes without needing to download files or use an FTP client.
Creating a New File
- Open the File Manager in cPanel.
- Navigate to the directory where you want to create the file.
- Click New File in the toolbar.
- Enter the file name including the extension (e.g.,
contact.htmlorstyle.css). - Click Create New File.
Editing an Existing File
- Navigate to the file you want to edit in the File Manager.
- Right-click the file and select Edit for a plain text editor, or Code Editor for syntax-highlighted editing.
- The file will open in a new tab with the editor.
- Make your changes and click Save Changes.
Code Editor Features
The built-in code editor provides several helpful features:
- Syntax highlighting – Colour-coded syntax for PHP, HTML, CSS, JavaScript, and other languages.
- Line numbers – Easy reference for finding specific lines of code.
- Search and replace – Find specific text within the file and replace it.
- Encoding selection – Choose the character encoding when opening files to prevent character display issues.
Best Practices for Online Editing
- Always back up first – Before editing any file, make a copy of the original. Right-click and select Copy to create a backup.
- Edit one file at a time – Avoid having multiple files open for editing simultaneously to prevent confusion.
- Test after saving – Visit your website after saving changes to verify everything works correctly.
- Use the code editor for code – The code editor with syntax highlighting makes it easier to spot errors in PHP, HTML, and CSS files.
File Types You Can Edit
The online editor works with any text-based file including .html, .php, .css, .js, .txt, .htaccess, .xml, and .json. Binary files such as images, videos, and executables cannot be edited with the text editor.