How to Edit a Website File on Your Server

Learn How to Edit a Website File on Your Server

In this guide, we will show you how to edit a website file on your server. Many times when you are configuring your website you will need to modify a file, such as when you are updating a code or a file path. There are several ways you can do this. For example, you can use the cPanel File Manager editor, an FTP program, or a program like Notepad++ to edit files.

NOTE: When updating files on your server, you may need to clear your browser cache to see the changes. For more information on clearing your browser cache, please see the article on How to Clear Your Browser’s Cache.

Edit a Website With File Manager in cPanel

You can edit files directly on your server using the File Manager editor. File Manager is a browser-based editor you can find in your cPanel.

This is sometimes called “Editing on the fly“. Editing on the fly is usually reserved for minor changes. When editing files directly on the server, the change takes effect immediately. The problem with editing files directly on the server is that you are editing the live copy. When editing the live copy, your site can break if a mistake happens and you cannot undo the change after it is saved.

In order to edit a backup copy of your files, you may want to use FTP instead. This is because, with FTP you typically download a copy of the file you want to edit, then upload and replace the old file. We will cover FTP more in-depth in the sections below. But, first here is a general step-by-step on how to edit files through the File Manager.

NOTE: If you do not know where your files are located on the server, please see our article on What directory should I put my files in?.

  1. Log into your cPanel.
  2. Go to the File Manager in cPanel.
    Edit Website Files with cPanel File Manager
  3. Select your directory.
  4. Right-click and Edit the file with the File Manager editor.
    Edit .htaccess File and Setup 301 Redirect
  5. You can then edit the file as needed.
    Editing a File Using cPanel File Manager
  6. Save the changes. You can then view your live site and see the changes.

Using FTP to Edit Website

Files can be downloaded and uploaded using an FTP client installed on your computer. For example, you can edit a PHP file, or edit an HTML file by downloading it and making changes then uploading it when you are finished.

Since FTP programs run directly on your computer, there is no need to access cPanel or an internet browser before accessing your files.

Below are the basic steps to edit a file using FTP. For more information please see our Getting Started Guide: FTP article.

  1. Connect with FTP. Below is a screenshot of FileZilla connected to my server’s public_html folder.
    Connected to FTP Using FileZilla
  2. Download the file.
  3. Edit the file on your computer with notepad or another code editor such as Sublime Text.
  4. Re-upload the file to the server and overwrite the existing file. The changes should reflect now on your live site.

Edit a Website With an Editor Like Notepad++

You can edit files directly on your server using Notepad++. NotePad++ is a Windows-based editing program that also has FTP capabilities. This means you can use this single program to connect with FTP and edit the file as well.

For information on editing your files with Notepad++, please see the following article:

To see other articles available on how to manage your files, please visit How to manage your files on your server?.

Make sure your business, agency, or reseller clients are always connected and powered on with our optimized Managed VPS Hosting.
JB
John-Paul Briones Content Writer II

John-Paul is an Electronics Engineer that spent most of his career in IT. He has been a Technical Writer for InMotion since 2013.

More Articles by John-Paul

39 thoughts on “How to Edit a Website File on Your Server

  1. Why is it that when I try to edit some html files in file editor, the editor is greyed out or not active while others can be edited.

  2. Hi,

    I changed a telephone number on a php file on my fathers website as i said i could do it for him(maybe i shouldnt have :)). The php file will know not display products. If i change a php file do the rest of the files need updating?

    here is the link to the site

    https://www.pneutube.co.uk/search/catsearch.php?ProductRange=SP+AIR+TOOLS&Family=CUTTING+TOOLS

    when i click on display nothing appears? any ideas guys

    1. I looked at the page as well and I’m not sure that you didn’t change more than just the phone number. Are you able to change it back and see the page work? Or do you have a backup of the old file? If the issue repeats after returning it to the original file, then there’s something else causing the issue. You may need to speak with an experienced programmer to investigate the issue.

  3. Hi support,

    1. in the physical website I can view and see my coding but when I am using the      wordpress editior, I am not able to view the coding

    2. how do you locate the file name in ftp for example in my wordpress my webpage file name is PROMOTION1 but in ft how do I locate this file. I know it is under theme folder but I could not find

    thanks hope to get your support soon

    1. Thats not how WordPress works. Pages in WordPress aren’t created as files. WordPress is a dynamic content management system and stores pages and its data within a database.

  4. I cleaned the cache, tried with different browsers and even from different computers. did not work. can it be that, www.WEBPAGE.com and ftp.WEBPAGE.com go to two different loctions?

    thanks.

    1. Yes, this could be the issue. As a test, you can try using your Shared IP as your hostname. This will ensure you are connecting to the correct server.

      Thank you,
      John-Paul

    2. I advise you take a look at some online courses or something like Codecademy. This is a help forum, but we cannot provide individual tutoring or something like code education. Best of luck to you!

  5. Hi, 

    i was asked to do some changes on an existing webpage.

    i have connected to the ftp server via dreamweaver, downloaded all the ebpage content. did changes and uploaded back.

    but, the problem is, when i visit the webpage via web browser, i dont see any updates.

    plz help 

    thx

    1. You may need to clear your web browsers cache. I suggest doing that. If that doesn’t work, I would check to be sure the files are uploaded in the correct location.

  6. I’m looking for mass css files minifier running on Server.

    Is there some tool that can minify mass css while on server? In my Joomla there are some plugins but I’d like do it oneces with no weight of plugin that constantly optimize web.

    or soe reg expression that I can open in ftp client with searching all css files…

    by ******.org

    1. Hello Niepelnosprawny,org,

      Thanks for the question about a CSS minifier. There are many online minifying tools. I would suggest using a search engine to look at current results for minifiers as there are too many to sort out. Check out this command line minifyer as an example what you might find. If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  7. Hi guys

    Im trying to edit my .htaccess file on the cpanel server but it wont allow me. I tried to download the file but because its a hidden file its difficult to locate, then i tried using notepad++ but it failing to log i. Im also using clod duck to upload ftp files but iIm failling to edit the hidden file 

  8. I edited my index.html file at file manager editor but why is it, it does not took effect. There is a link that I unlink and also an image i delete. But when i hit save and browse my site, it is still not changing. the link and the image is still there. what is the cause of this issue?

  9. Hi –  I recently started using InMotion and am building my site on my local Host before uploading – I already have a ModX site (Php5 and Mysql) running on another webserver that I would like to port over to InMotion –  I see the Droopal and Jumula support on InMotion but am wondering whether there are any plans for InMotion to provide support for ModX Reolution in the future.

    Thnaks in advance

    1. Hello George,

      You can always ask a question about Mod X if you run across an error or need assistance. There are no current plans to create a Mod X education channel or articles, however.

      Kindest Regards,
      Scott M

  10. I’m having an issue with seeing my updates take effect.  Whether I try to update a file as shown in the video or upload and replace the file, my site does not load the changes.  This is a frustrating issue I had a couple of months ago and noticed that I could only see the changes happen when I renamed all the files completlly and uploaded them.  For example I uploaded some bmp images not knowing browsers didn’t support it so I saved them as jpg uploaded them, and edited my code with the changes but when I loaded my site the images were still boken.  Can someone please help me with this.  I’ve tried clearing everything in my browser in case something is being cached but I’m having no luck and need this site up by Monday.  Thanks

    1. Hello Pedro,

      Are you using some type of caching plugin? Have you tried different browsers? Different devices? It sounds as if it is some sort of caching somewhere.

      Kindest Regards,
      Scott M

  11. Okay we made a page for our site by a professional and we go a css.zip, bin.zip and a html page for our letter through our mail.  Now d problem is that am confused on how to upload the page on c panel cause i was hoping to get a zip file so we could easily upload once but now am confused cause i want all pages to work fine  

    1. Hello Developer,

      Thank you for contacting us. I’m not sure exactly what you are asking, but you can upload files to your server at any time.

      You can also zip/unzip files on the server at any time.

      Let us know if you have any further questions.

      Thank you,
      John-Paul

  12. Hello guys i new here and i want o edit my old php file suddenly i have lost some data and i want to add that back into my site’s script that is a ptc sites script and countries are missing in that file so tell me how can i put countries in that file?

    1. Hello Hamza,

      Thank you for contacting us. We are happy to help, but it is not clear what you are trying to accomplish.

      Please provide more detailed information into what you are trying to accomplish.

      Thank you,
      John-Paul

  13. Hello,  Thanks for the video.  It taught me soemthing, but I still am not able to figure out something in my website.  I am asking around and people trying to make me pay for full redoing of my website and expecting me to pay monthly maintenance which, I can not afford.  few months ago I could easily go into my cpanel and change the store hours, but surprisingly that has disappeared now.  I forgot to change my passwords and the person who created still had access until recently and demanding more money to change it.  Can you help?  I don’t see the contact page coding anywhere in the cpanel.  Looks like it’s been routed to different place to pick from and can’t find it.  Any help is really appreciated.

    1. Hello Arundhati,

      I would not mind taking a look, but there is no domain name given.

      Kindest Regards,
      Scott M

  14. Hi!

    I am new to cPanel and php.  I am wanting to make a few changes to some forms on our site.  When I log on to the developer site and right click on the form element and select “inspect element”  I can see html code in the console but when I go to the file manager in cPanel and click on the exact same file, the html tags arent’ there.  Should I be looking somewhere else?  Help! lol

    Sincerely, Brandi B.

    1. Hello Brandi,

      Many Content Management Systems (CMSes) are written in PHP. PHP is then interpreted by the server and the output is HTML. This is why you see HTML in the browser and can see HTML code when you View Source or Inspect Elements. The actual files on the server, however, are PHP and look different. You can still find the place in the PHP file that prints the HTML to the browser, but it is usually among other PHP code as well, so finding it is not as easy as with a normal HTML page.

      Kindest Regards,
      Scott M

  15. Is there a way to download or sync ALL folders & files to FTP.

    I am using Core FTP LE – which I believe is set up correctly, but it doesn’t show all folders, only:

    <..>

    ..

    .ftpquata

     

    Is my FTP set up incorrectly or am I missing something (mentally)? 

    Thank you so much, in advance!

    1. Hello Alexandra,

      Thank you for contacting us. When you create an FTP account, the Directory, and Quota are also set.

      It is limited to the directory you set there. To give them full access to your file system, just enter a forward slash, like this: /

      Thank you,
      John-Paul

  16. Hi,

    Does notepad++ have the abilty to test the amended php before its uploade and over writes the php file on the sever?

    1. Hello John,

      No, notepad does not have that ability as php is interpreted by the web server software. You can, however, set up a WAMP on your local machine, allowing your PC to act as a webserver. This way you can test php files prior to uploading. Alternatively, you can simply rename the file on the server by appending .hold or something else and then upload the new file. This way it does not overwrite and you can simply delete the new file if it is not working and rename the old file back.

      Kindest Regards,
      Scott M

  17. I am newbee for PHP. I want to edit my website which was previously developed by a professional. I am trying to find the database file of my website in public_html. How to find it? Please help.. Thanks!!!

    1. Hello Amar,

      Thank you for your question. Your database information will be listed in your configuration file, which will differ based on the software you are using.

      You will need to locate your config file, which will list your database name and user information.

      If you have any further questions, feel free to post them below.

      Thank you,
      John-Paul

  18. when i put the quicktime code in my microsoft front page source code area  the writing appears on the htm page as well as the source page

    1. Hello James,

      Thanks for the question. Quicktime is generally a video protocol from Apple. It’s not something you can edit in FrontPage. You would need to have a video editor that can work with quicktime in order to edit it. I hope this helps to answer your question, please let us know if you require any further assistance.

      What is Quicktime?

      Regards,
      Arnel C.

Was this article helpful? Join the conversation!