Easy Fix For WordPress Plugin Update Asking For FTP

Bulletproof Backups for Your WordPress Website

Fortify your business continuity with foolproof WordPress backups. No data loss, no downtime — just secure, seamless operation.

We were trying to update WordPress on a new testing site, and mid-update, came across the following error:

A plugin update asking for FTP credentials is confusing, and even though we retried the update multiple times, nothing seemed to work. 

If you’ve come face to face with the same error, we understand your confusion. We also understand your worry. Is it safe to do so? Why is WordPress even asking for this? More importantly, are there alternative methods to update the plugin without adding your FTP login details? 

First of all, it’s fixable. It will only take you a few minutes. In this article, we will tell you how to safely update your plugins without the error. 

TL;DR: If WordPress is asking for FTP credentials, it is because it doesn’t have the right permissions to make changes to files. You have to give WordPress direct permission by making changes to your wp-config.php file. Keep in mind that this is a core file, so we recommend you take a backup with BlogVault before making any changes. 

Why is my WordPress plugin update asking for FTP credentials?

When you attempt to update a plugin, WordPress may sometimes ask for FTP credentials. The short answer is that WordPress doesn’t have the right permissions to make changes to site files. This typically happens for a few key reasons:

  • File permissions: Your web server might not have the proper permissions to write to files directly. Without these permissions, WordPress can’t update files on its own and needs—and therefore asks for—FTP access.
  • Server configuration: Some server environments are set up to require FTP or FTPS for file modifications. This is a security measure to prevent unauthorized changes to your files.
  • File ownership: If the files on your server are owned by a different user than the one running WordPress, direct updates might be blocked, prompting WordPress to ask for FTP credentials to gain the necessary access.
  • Security issues: Your webhost or a security plugin could restrict access for security reasons. You may not even know till you try to update a plugin for the first time. But we can fix it.  

Fix WordPress plugin asking for FTP credentials

Providing your FTP credentials to WordPress is generally safe, especially if you are using a secure and trusted hosting environment. The credentials are used temporarily during the update or installation process and then discarded. So the quick fix would be to give the credentials. 

  1. Head to your hosting account. We are using Cloudways for this. 
  2. Navigate to your site’s dashboard.
  1. Look for the SSH or SFTP credentials section. 
  2. If you haven’t already created credentials, click Add SFTP User. Then, add a new username and a password in the popup.Click Submit to save.
  3. Take note of the username, password, and the public IP address.
  4. Head to your admin panel and select either FTP or FTPS at the bottom. Add your newly created credentials. Click Proceed.

How to avoid WordPress plugin update asking for FTP credentials

When you’re updating one plugin, this is not too much trouble. Annoying, but doable. But, if you have to keep repeating the process every time you make major changes to your site, like a WordPress core update, it can quickly become tedious. Let’s set up your server to handle WordPress updates without needing your FTP credentials. 

Note: Take a full backup with BlogVault before making any changes to your site. This gives you something to fall back on, if things go awry. This is especially important because you’re making changes to your core files. 

1. Set the correct file permissions

Ensure that your WordPress files and directories have appropriate permissions to allow the web server to read, write, and execute files as needed. Typically, directories should have permissions set to 755. Files should generally have permissions set to 644. Check your file permissions before you make any more changes. 

2. Define FS_METHOD in wp-config.php

The `FS_METHOD` stands for “File System Method” and refers to the method WordPress uses to interact with the file system. It defines how the file system is accessed for operations like updates and plugin installations. There are four main methods: 

  • Direct: Allows WordPress to write files directly
  • ftpext: Uses the FTP PHP extension and requires credentials
  • ftpsockets: Serves as a fallback if the FTP extension is not installed
  • ssh2: Uses the SSH PHP extension and typically requires SSH keys and credentials 

We will be setting it to direct to bypass the need for FTP credentials. There are two ways to do so:

Option A: Using an FTP client 

  1. Install an FTP client on your system. We are using Cyberduck. 
  2. Click Open Connection. Add your FTP username and password. Add your public IP address or hostname. Select FTP or SFTP from the dropdown. Click Connect.
  1. Once you’re connected to the server, you’ll see a list of folders. Open the root folder of your site, often called public_html or www
  2. Scroll till you find the wp-config.php file and double click on it. The file will open in a text editor.
  3. Search for the phrase: FS_METHOD. If it is missing,  add the following line just above the `/* That’s all, stop editing! Happy blogging. */` comment: 
define('FS_METHOD', 'direct');
  1. If it is present, replace it instead.
  2. Save the file and upload it to your server using Cyberduck.You will be prompted to Overwrite the existing file. Click Yes to do so.

Option B: Using cPanel

  1. Access your cPanel login page, typically found at yourdomain.com/cpanel, and log in with your username and password.
  2. Within the cPanel dashboard, locate the File Manager icon and click on it to open the file management interface.
  1. In the File Manager, locate your site root directory, which is often named public_html or www. Double-click on this folder to open it.
  2. Within the root directory, scroll through the list of files until you find wp-config.php.
  3. Right-click on the wp-config.php file and select Edit. A pop-up may ask for confirmation to edit. Click Edit again to proceed.
Website File Manager
WP-Config.php can be modified directly using a file manager.
  1. Once the file is open in the text editor, look for the phrase FS_METHOD. You can usually use the search function (Ctrl + F or Command + F) to find it quickly.
  2. If the FS_METHOD line is missing, add the following line just above the `/* That’s all, stop editing! Happy blogging. */` comment:
define('FS_METHOD', 'direct');
  1. If FS_METHOD is present but set to something else, replace it with:
define('FS_METHOD', 'direct');
  1. Click the Save Changes button in the top-right corner of the editor to save your modifications.
  2. After saving, close the text editor to return to the File Manager.

Best practices around updating WordPress plugins

Regularly updating your WordPress plugins is crucial for maintaining the security, functionality, and performance of your site. Here are some best practices to ensure a smooth and secure updating process:

  • Only trust specific users to update plugins. Ensure these users have the minimum necessary permissions to perform updates, enhancing your site’s security.
  • Always backup your entire site before applying any updates. Use plugins like BlogVault to do so. This ensures you can quickly revert any changes, with a one-click restore in case something goes wrong.
  • Verify that the plugin is compatible with your current WordPress version to avoid conflicts or errors. Check the plugin’s changelog and update notes for any crucial changes or known issues.
  • Before applying them on your live site, test the updates in a staging environment. This allows you to identify and fix issues without affecting your live site. You can create one easily with BlogVault. Just head to the staging section and click Create Staging Site.
  • Ensure you have a reliable internet connection to prevent incomplete updates, which can lead to site issues.
  • Temporarily deactivate caching plugins during updates to avoid potential conflicts and ensure new changes are properly processed.
  • Update plugins one at a time to easily identify and troubleshoot any issues that arise during the update process.
  • After updating plugins, monitor your site for any errors or issues. Check the functionality of key features to ensure everything is working as expected.
  • Disable automatic updates for large or critical plugins like Elementor or Divi. They have a tendency to crash sites. So, you need to take precautions like a backup before you manually update the plugin. 
  • Use WordPress plugins like BlogVault to add extra layers of protection such as vulnerability detection. It will help you figure out which plugins need updates immediately. 

Final Thoughts

While providing FTP credentials is safe, it can be frustrating to do every time you update something. We recommend you tweak the wp-config.php file a little to make it easier for you. But before making any changes to your site, take a backup with BlogVault. BlogVault offers automatic daily backups that are stored offsite and are easy to restore in case something goes awry. 

FAQs

Why is WordPress asking for FTP details?

When you’re trying to update a plugin, WordPress may ask you for FTP details because it needs permission to access your files and make the necessary changes. If your server doesn’t have the right settings, WordPress can’t update files directly and asks for FTP login information instead.

Can I update WordPress plugins without providing FTP access?

To avoid entering FTP details every time, you can change some settings on your server:

  • Make sure the files and folders in your WordPress directory have the right permissions. Typically, folders should be set to 755 and files to 644.
  • You can add a line to your `wp-config.php` file: `define(‘FS_METHOD’, ‘direct’);`. This tells WordPress to update files directly without needing FTP.

How do I update WordPress plugins with FTP?

If you need to use FTP to update a plugin, here’s a simple step-by-step guide:

  1. Download the latest version of the plugin from the WordPress repository or developer’s site. 
  2. Extract the files if they are in a zip folder. 
  3. Install an FTP client like FileZilla or Cyberduck.
  4. Enter your FTP details (host, username, password, and port) to connect to your server.
  5. Navigate to wp-content/plugins/ in your FTP client.
  6. Upload these files to the appropriate plugin folder, overwriting the old files.

Tags:

You may also like


4 Easy Ways to Enable WordPress Maintenance Mode
4 Easy Ways to Enable WordPress Maintenance Mode

You have a WordPress site that you’re really proud of. It’s where people come to learn about your content or buy your products and services. Now, think about what would…

How do you update and backup your website?

Creating Backup and Updating website can be time consuming and error-prone. BlogVault will save you hours everyday while providing you complete peace of mind.

Updating Everything Manually?

But it’s too time consuming, complicated and stops you from achieving your full potential. You don’t want to put your business at risk with inefficient management.

Backup Your WordPress Site

Install the plugin on your website, let it sync and you’re done. Get automated, scheduled backups for your critical site data, and make sure your website never experiences downtime again.