Support » Fixing WordPress » Better to edit php files in FTP or WordPress?

  • Hi,

    Just a quick general question, for which I can’t find the answer in a forum search.

    When editing the template of your WordPress theme, is it better to do in WordPress editor itself or through the FTP client?

    I need to edit an archive.php file but am not sure which is the best way to do it, or if the changes will filter through to either one. (ie if I edit through WordPress will it automatically edit the FTP file).

    Thanks in advance

Viewing 15 replies - 1 through 15 (of 19 total)
  • Just to clarify, are you talking about versions on your own computer and your hosting? If you are then using the WP editor will amend the one on your hosting. If you need a copy on your computer you’ll need to ftp it back again.

    Okay so am I right in saying there are 3 elements here: FTP, WordPress editor and the hosting account (CPanel or whatever)?

    Editing the theme through the WordPress editor (via dashboard) edits the hosting (CPanel) files? But not the FTP files?

    Whereas editing the file via FTP Client edits all three?

    If so that would mean its better to edit files through the FTP Client…

    Am I right?

    Ah, you’re using a WP installation through your hosting. I apologise but I’ve not used that route before. It is possible that using FTP to edit a file from CPanel may be the same as using the WP editor. When you save using the FTP client does it copy it back automatically? If yes then there is no difference in the end result.



    Volunteer Moderator

    Just to clarify – you can edit template files which are in webhost’s server via cpanel and WordPress editor. However, you don’t have a copy/backup of your edits in your computer hard drive because all changes were made online.

    When you edit your template files in your computer’s hard drive with a text editor and save it, you can upload the revised template file via FTP or cpanel upload. In this scenario, you have the revised template file in your hard drive and webhost server.

    Ok thanks, so best way therefore is to download file to FTP Client, edit and re-upload?

    Doesn’t that mean you lose any backup, because you have edited it completely? I’m new to WP, and the relationship between FTP, the WP editor and the hosting account, and where backups are stored and kept is confusing me!

    Moderator kmessinger


    FTP is file transfer protocol. It moves files from and to the server and from and to your computer. It has nothing to do with editing files.

    If you edit a file with WP editor, you need to FTP that file back to your computer if you want a backup. If you edit a file on your computer you need to FTP it to the server for any changes to take place.

    Make a backup copy of the file you are going to edit – I make a folder called “Archive” to store backups and past changes much of the time, the Archive folder is below the folder that the file I am editing is in. I do the editing with Notepad++ mostly and then ftp the file back to my site.

    Thanks guys.

    @saildude – an Archive folder in the local site or remote site?

    Archive folder is usually on my desk PC – you could also make an archive folder on your remote site if you wanted. Sometimes I will rename the old file on my site just before I ftp a new file up – that is probably not a good idea on a high traffic site. The important thing is to have a backup file in case any changes turn out real bad – then just put the old file back and not need to worry about backing out changes.

    I guess if you downloaded a theme you can use the original theme files as backup…

    Correct the original Theme Download can be your backup – I did that with my Theme. I modified 2 Theme files and they are in a Folder called Web Changes.

    I usually also edit in cpanel, or in WordPress site admin if it has to do with the template: Admin < Appearance < Editor, depends on how big the file, if it’s too big, then in cpanel is better in my opinion. But don’t forget to make yourself backup or your files in case you made something wrong. Good luck 🙂

    Hi guys, thanks 🙂

    1, Kim – how do you edit in cpanel? Does editing in cpanel automaticall filter to the FTP client? Or the WP editor? Or neither?!

    2, Also have one other FTP related question – how do you upload images to posts without the FTP Client? I’m just thinking, if someone other than me (i.e. without access to the FTP client, writes an article and wants to upload an image, where would he/she upload it?)

    Still pretty confused about the relationship between the 3 (FTP, WP, host) as you can tell!

    Let’s assume you want to edit a theme file–you could edit a specific file in three ways:
    1. In Administration > Appearance > Editor
    2. Via FTP Client such as FileZilla
    3. Via cPanel File Manager, Edit option.
    Each method is a bit different and really not related, but the end result is same.

    As for your image upload question you can upload an image when writing or editing a post and you don’t need FTP to do that.

    Hi Michael, thanks.

    So how does one keep everything in order? I mean, each post you write you could edit in a different way and then one day if something goes wrong you have no idea where everything is, right? Is there a sort of ‘standard’ or ‘best’ way of going about it?

    Re: images, I guess I’m getting at the same question – how do you go about making sure images are all in one place (including those uploaded by other posters on other computers) so that if you lose everything you can still access them?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Better to edit php files in FTP or WordPress?’ is closed to new replies.