Editing a text file in cPanel File Manager

File Manager can make a focused change to a website text or configuration file. Saving writes directly to the hosting account, so a small typo in PHP, JSON or server configuration can affect the live application.

What you need before you begin

Confirm the exact file and domain, then download a copy before editing. If the directory belongs to a Git deployment, use that project’s deployment workflow so a manual edit is not lost or put the repository out of sync. Avoid simultaneous edits in two browser tabs.

01 Edit a text file in cPanel File Manager

  1. Open File Manager and navigate to the file. Use View or Download first if you only need to inspect it.
  2. Select the single file and choose Edit. Confirm the existing character encoding when prompted. If the text appears corrupted, cancel rather than saving it under a guessed encoding.
  3. Make the smallest intended change and preserve the surrounding syntax, quoting and line endings where relevant. Use a plain code editor for configuration, not a visual HTML editor.
  4. Save the changes, then reopen or download the file to verify that the intended text was written.
  5. Test the affected page or application action immediately while the original backup is easy to restore.

Confirm the expected result

Check both the visible result and the application error log. A saved file is not proof that the edited code or configuration is valid.

How do I recover if a File Manager edit breaks the site?

If the site fails, restore the original file and retest before making another change. Very large files may exceed the built-in editor’s limit; download, edit locally and upload carefully. Never paste a complete configuration replacement without accounting for existing service-specific settings.

Sources and further reading

  • 0 Users Found This Useful
  • cpanel-whm, web-hosting
Was this answer helpful?

Related Articles

Uploading website files with cPanel File Manager

File Manager is useful for a small deployment or a single file change without installing an FTP...

Creating files and folders in cPanel File Manager

Create a folder to organise website assets or a file for a specific application task. An empty...

Finding and editing .htaccess in cPanel

The .htaccess file can control redirects, access restrictions and application rewrite rules on...

Creating a restricted cPanel Web Disk account

Web Disk provides WebDAV access to server files. An additional Web Disk user can manage a...

Connecting a computer to cPanel Web Disk

A WebDAV client can connect to cPanel Web Disk so remote files appear in a desktop...