In this KB
- Launching SSH terminal
- Navigate to wp-config.php File
- Fixing WordPress FTP credentials error
In this entry, you will learn how to fix the error where WordPress asks for FTP credentials. A sample of the error is shown in the screenshot below:
The error usually occurs when define(‘FS_METHOD’,’direct’); in wp-config.php is missing. This function allows the current user to edit or install files in your folder. Here is how you can remedy this issue:
Step 1: Go to Server Management
Log into the Cloudways Platform with your credentials. Click on Servers in the top menu bar and then select your target server from the list.
Step 2: Launch SSH Terminal
Now, click Launch SSH Terminal button inside the Master Credentials tab. You can also connect your server using SSH client (PuTTy).
Step 3: Navigate to wp-config.php File
Type the following command to edit the wp-config.php file:
Now, press i to start editing the file and paste the following code:
After pasting the code, press the ESC key and type :wq! to save and exit the file.
That’s it. You should no longer be able to receive the WordPress FTP credentials error.