FTP (File Transfer Protocol) is a very useful and easy way to upload files to your website hosting server.
FTP simply allows you to transfer files from one computer to another. This means we can use FTP to transfer files to and from our PC to our website server, and vice versa.
All you need in order to achieve this is the following:
- An account with a hosting company (i.e SiteGround)
- Your hostname
- Your FTP username & Password
- A FTP program (such as Filezilla, WinSCP…)
Make sure you’ve got an account with a hosting company (in this example we will use, Siteground).
Login to your account on the hosting company website.
Once logged in, click on ”manage account” – n.b other hosting websites may have a different interface, but you want to go into ”your account” essentially, regardless of who your hosting company is.
For Siteground, click > manage account > Information and settings.
Find your FTP details on this page. On Siteground you will see the following (take a note of them):
cPanel username: xxxxxxxxxxx
FTP hostname: xxxxxxxxxxx
FTP Password: xxxxxxxxxxx
Download and Install a free FTP program. I’ve listed the official download links for FileZilla and WinSCP below (2 excellent FTP programs). Choose which ever one you prefer, its 6 and half a dozen. Though for this tutorial we will be using FileZilla, so feel free to install that and follow the rest of this guide.
Offical website and download page for FileZilla (click the download FileZilla client)
Once you have installed FileZilla, open it.
Then do the following to setup your site in ”Site Manager” – this will save you having to put your FTP credentials in every single time you want to use FTP for your site:
(1) – Click on the ”Site Manager” icon located under ”File”.
(2) – Click on ”New Site”
(3) – Enter your FTP hostname. This is your FTP hostname which is listed under the ”FTP hostname” heading in manage account > information and settings in cPanel.
(4) – Always set the port to 21.
(5) – Logon Type = Normal
(6) – User: This is your username (i.e your cPanel username for example – found on the manage account > information and settings page)
(7) – The password you use to log into cPanel.
(8) – Click ”New Site” and rename it to the name of your website, this will help you identify it later (especially if you have more then x1 site).
(9) – Click ”Connect”.
After clicking connect then, you’ll notice a connection is trying to be established to the website hosting server where your website / website files are located.
On the left hand side of the screen, this is your ”local Site” (the PC your working on right now), and on the right hand side of the screen you can see ”Remote site”, which is the website server you are trying to access over FTP.
When the connection is successful, you will notice the ”Remote Site” section is now populated with your website files and folders. I’ve highlighted this in green below, thats my websites ”public_html” folder.
Congratulations, now you have a connection to your website server and can access all your website folders & files through FTP.
Lets go a little further here though…
You may (or may not) have read, one of my other articles about ”how-to: Fix syntax errors on your self hosting website” and that you can achieve this by signing into cPanel and locating the file and piece of bad code and correcting it OR, you can also achieve this by using FTP.
As the example in my other article relates to a syntax error found in the public_html/wp-content/themes/parament/functions.php file, lets continue the steps here and we will show you how to locate and download the functions.php file for editing, then re-uploading it to the directory above to resolve the syntax error using FTP.
Follow steps though (1-8) in this guide.
Expand the wp-content folder > themes folder > parament (or your theme name) folder (see screenshot below). Then look in the theme name folder (parament in this example) for the functions.php file where the bad bit of code is located.
After locating the functions.php file, right click on it and hit Download (as shown below).
Once you have downloaded the functions.php file, you can use a program such as Notepad++ to open, edit / remove the bad piece of code, and save the file, ready to re-upload.
Once you have saved the edited functions.php file to your desktop, go back into FileZilla (you should still be connected).
On the left panel of the screen under ”Local site”, select your desktop and then scroll down until you find the edited functions.php file and then right click on it, as seen below:
When you hit upload, you may see a warning message asking you if you wish to overwrite the functions.php file that is already there in the ‘remote site” location, say yes to this. This will overwrite the bad functions.php file with the brand new one you just edited.
And that is it, once you’ve edited the bad code, or removed it altogether from the functions.php file and re-uploaded it to its original folder, your website should work again as normal, no more syntax errors.
If you have any questions on this, feel free to leave a comment and I’ll get back to you.