What is FTP protocol
FTP (File Transfer Protocol) is a “means of transport” used to transfer files from your local computer to a remote website, such as a WordPress blog. FTP can also be used to download files from your WordPress website to your computer or to change files and directories permissions on a remote website.
Why do you need to know how to use FTP?
FTP is a very important protocol for any webmaster. There are various reasons why it is essential that you are able to use FTP:
Upload files to your website
From time to time you might need to transfer files, such as imges or HTML verification files, from your computer to your website, and you will need FTP as a means of transportation.
Delete files from your WordPress website
Sometimes after uploading new plugin, upon activation you discover that this plugin is incompatible and the WordPress administrator console is unavailable. In this case, the only way to solve such a problem is to connect via FTP to the website, navigate to the WordPress plugins directory and delete the plugin. The WordPress plugins files are stored in the /wp-content/plugins directory in WordPress.
Modifying a WordPress theme
From time to time, you may need to change your WordPress theme or modify an existing one. Pasting a piece code from tutorials to the Appereance > Editor window in the WordPress dashboard can accidentally lock you out, or break something. The best way to go about this is to login via FTP, download the WordPress theme file, modify it and upload it again to the WordPress themes directory. The WordPress themes directory is /wp-content/themes/.
Change file and directory permissions
Some WordPress plugins require the creation of a temporary directory or single to store cache data in it. If these WordPress plugins do not have the appropriate permissions to create such a file or directory, the WordPress plugin will generate errors and will not function properly. In this case you need to change directory and file permissions so the WordPress plugin is able to create and write to a directory.
What information do you need to connect to your WordPress blog using an FTP client?
- A Host or hostname of the remote server. ITypically this is the web address or URL of your WordPress blog e.g. www.website.com.
- A username and password to authenticate and be able to access your WordPress blog or website. Typically, such credentials are provided to you by your hosting provider upon registering which you use to access your CPanel. If not, you can always create a new FTP username and password from your hosting user portal and configure it to be able to access the WordPress files.
- An FTP client software. There are many different FTP client software available on the market. One of the best FTP Clients is FTP FileZilla and it is available for download for free.
Note: The host, username and password should be entered in Section 1 highlighted in red in screenshot 1 below.
How to use the FTP to upload and transfer WordPress files
Once you’ve inserted on the details specified in the Section 1 above, click the ‘Quick Connect’ button (highlighted in red and marked as section 2 screenshot 1 above). Once you are connected to your WordPress website,you will be able to see the following sections in your FTP client (all highlighted in red in screenshot 1 above):
- Section 3: Local computer directory location
- Section 4: Files stored in the highlighted local directory
- Section 5: Remote website (WordPress blog) directory location
- Section 6: File stored ni the highlighted remote directory
To upload a file from your local computer to your WordPress blog or website, simply drag and drop the file from the local site section (Section 4 in screenshot 1 above) to the remote site section (Section 6 in screenshot 1 above). Therefore, if you need to upload a modified WordPress theme file, on the remote website navigate to ‘wp-content/themes/[theme directory]. Once you are in such directory, drag and drop the file footer.php to the remote site section.
WP White Security Security Tip: When using the FTP protocol, credentials and file content are sent over the internet using clear text, i.e. a malicious user might be able to intercept your credentials and login to your website. Ideally you should always use SFTP (also known as FTPS).
How to change WordPress file or directory permissions
To change the permissions of a file or directory in your WordPress blog, you can either:
a) use the CHMOD FTP command; or
b) simply right click on such file or directory and select “File Permissions”
WP White Security Security Tip: In most cases, files should be assigned READ ONLY permissions, with the exception to allow the owner to have WRITE permissions as well to be able to overwrite them when uploading a new file.
More info at our blog