If you find that WordPress is continually asking for your FTP credentials when you’re trying to install an update, you’re not alone.
The error usually looks something like this:
Connection Information
To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.
This problem may appear when you initiate an update or try to install a new themeA WordPress theme is a set of files that determine the design and layout of a website. It controls everything … More or pluginA plugin is a software component that adds specific features and functionality to your WordPress website. Esse… More. It results from WordPress having insufficient permissions to modify files on your server.
2 Solutions To WordPress Asking For FTP Credentials
We have identified two easy solutions to this problem, both of which will require you to edit the wp-config.php
file in your site’s root directory.
You can access this file by using an FTP client like FileZilla, or by using the file manager in your web hosting control panel.
Method 1: Force Direct Filesystem Method
This solution is quite simple and may solve your problem in a matter of seconds.
Simply add the following code to your wp-config.php
file:
define('FS_METHOD','direct');
This forces WordPress to use the “direct” PHP method for automatic updates, rather than utilizing FTP.
Once you’ve added this code, save the file and reattempt the update/installation that originally caused the error. If it installs normally, you’re good to go!
However, if you continue to have problems, remove the code you just added and proceed to Method 2.
Method 2: Add FTP Credentials To wp-config.php
If the first method didn’t work for you, you can also add your FTP information directly to your wp-config.php
file. This will allow WordPress to install updates via FTP without continuing to prompt you for your credentials.
To do so, add the following code to your wp-config.php
file:
define('FTP_USER', 'USERNAME');
define('FTP_PASS', 'PASSWORD');
define('FTP_HOST', 'FTP.EXAMPLE.COM');
Be sure to replace the username, password, and host with your own details. Check with your web host if you’re unsure about any of this information.
Once you’ve added the code above, save the file and reattempt the update in WordPress. It should work now!
Conclusion
Hopefully this quick troubleshooting guide helped to resolve the issue of WordPress asking for FTP credentials when trying to install an automatic update.
If you have any questions or run into any issues along the way, please feel free to leave a comment below!