Instructions for using FTP in WordPress website management

Tutorials 0 lượt xem

You are a newbie in the WordPress world. And you accidentally come across the phrase FTP.

You don’t understand what it is? Do you need to use FTP in website administration?

In this FTP tutorial, I’ll explain FTP, as well as show you how to use FTP to solve many tasks that the WordPress backend can’t do.

Mastering FTP takes you a step further in website administration from the beginning.

What is FTP?

FTP stands for File Transfer Protocol. It is a communication protocol in the network environment that helps you access the web server.

With FTP, you can transfer files between your computer and the server, change the permissions of folders and files on the server.

In short, FTP helps you manage all the files in your website except the database part.

Why you need FTP

There are few tasks you can use WordPress back end instead of FTP.

For example, you can upload files from your computer to a web server from WordPress’ Add media function. But the file size when uploading is limited. 

Another example you can add or edit CSS and PHP code using the Editor function inside the WordPress dashboard. Although this is not recommended for security reasons. You should turn off such file editing  .

Using FTP in the above two scenarios offers better power and security. ​

However, there are some situations where you must use FTP. When you install plugins, you may experience compatibility issues with existing plugins. As a result, you will see a white screen when accessing the website.

In this situation, you cannot access the WordPress Dashboard. You can only use FTP to access the host directly to remove the plugin causing the error.

The case is similar when you edit the code for the functions.php file . The code you added kills the website. Knowing how to use FTP helps you solve problems quickly.

To summarize a few situations where you need FTP:

  • Move the website to the new web server.
  • Remove or deactivate a plugin or theme that causes compatibility issues.
  • Change the wp-config.php file after you move the site, for example changing database connection information, enabling or disabling debug mode
  • Change permissions of files and folders
  • Note : You can use FileManager in cPanel instead of FTP to manage files on web server. 

FTP Client software

FTP Client is software that uses FTP to access the web server. Several FTP client software you can choose

FileZilla : supports all platforms.

Free FTP : for Windows

Cyberduck : for Windows, Mac.

If you are new to FTP, I recommend using FileZilla. The instructions below use FileZilla. 

How to connect FTP to web server

In order for the FTP Client to connect to the web server, you need the following 2 pieces of information

  1. The address of the web server can be in the form of an IP or a domain name.
  2. FTP account (username and password)

When you buy hosting, the hosting company creates a primary FTP account for you and provides access information in an email.


huong-dan-su-dung-ftp-1

Example of FTP access information when buying hosting from A2Hosting

The main FTP account on you cannot be deleted. But you can create more FTP accounts.

The good thing is that you can specify an account that can access a certain directory on the server. So if you give that account to someone else, you don’t have to worry about them touching files you don’t want.

To create an FTP account, go to cPanel. Move to the Files pane. Click the FTP Accounts icon.


huong-dan-su-dung-ftp-2

Enter username and password. Select the folder the user has access to. The Quota section selects the amount of data you want to transfer. Or leave Unlimited for unlimited file transfer. Click Create FTP Account . It’s done.


huong-dan-su-dung-ftp-3

The new user you create will be of the form username@yourdomain.com . When configuring the FTP Client below, you must enter the same username.

Configure FTP Client

After downloading FileZilla, open it and enter the connection information you had in the step above. Then click Quick connect to connect.


huong-dan-su-dung-ftp-4

If the connection is successful you will see the line Directory listing of “/” successful.

Another way to connect. You download the configuration file from cPanel to your computer.


huong-dan-su-dung-ftp-5

Next, in FileZilla you go to File -> Import . Select the configuration file you just downloaded and import it into FileZilla.


huong-dan-su-dung-ftp-6

To connect using a configuration file, go to File -> Site Manage r , click Connect. That way you don’t have to manually enter the address, username and password information as above.


huong-dan-su-dung-ftp-7

You have now successfully connected to the web server. I guide you to solve a few common tasks with FileZilla.

Transfer files via FTP

You notice the FileZilla interface divided into 2 areas. On the left hand side is the local site containing the files on your computer. On the right is the remote site containing all the files on the server side.


huong-dan-su-dung-ftp-8

When you click on a folder, the box below will pop up the entire folder contents.

To transfer files from local to the server, simply drag and drop the file onto the remote box

At the bottom of FileZilla’s screen you will see 3 Queued Files tabs: The file you selected is in the process of being transferred from your computer and the web server.


huong-dan-su-dung-ftp-9
  • ​Queued files : Files that are in the process of being transferred to the server.
  • Failed transfers : files with errors when transferring from local to server.
  • Successful transfers : a list of files successfully transferred to the server.

Upload digital files

When you upload technical files to the Uploads folder, WordPress will not recognize these files. Therefore, you will not see the file when accessing Media in WordPress Dashboard.

The fix you need to install the Add From Server plugin .

Manage File Permissions in FileZilla

Another task you use with FileZilla is to change the permissions of files and folders on the server.

To do so, you just need to right-click on the desired folder and file. When the context menu appears, select Permission. Permissions dialog box pops up. Change the permissions you want.

Edit files using FileZilla.

To edit the file you can do 2 ways:

First, edit directly on the server. This way FileZilla will create a temporary file on your computer.

This way, you just need to right-click on the file you want to edit on the remote site. In the context menu, you choose View / Edit File and edit the file.

The other way, you drag the file to local and edit it locally. Then you re-upload the file to the server. Then FileZilla detects that the file already exists and gives you many options. Please select override.

Before editing a file, you should create a backup file in case something goes wrong. For example, if I edit the wp-config.php file, I will create a backup file named wp-config-bak.php.

Then proceed to edit the wp-config.php file. In case there is a correction, we can easily revert back to the original original file

Conclusion

As you can see, knowing how to use FTP makes the task of website administration a breeze.

FTP does many tasks that the WordPress backend cannot do, such as changing file permissions.

One point I repeat:

If you want to edit the .htaccess file, use FTP. Because by default you will not see this file when using File Manager in cPanel. If you want to edit this file in cPanel’s File Manager, refer to this article . 

With this FTP user guide, you learned more about FTP and how to use FTP. ​

If you have problems using FTP, please leave a comment below. I am always ready to help you with any WordPress related issues. 

If you liked this article of mine, sign up for an email to get notified when there’s a new post.

Icon made by http://www.flaticon.com/authors/freepik from www.flaticon.com

Bài viết liên quan