Upgrade and update WordPress automatically without using FTP

In some cases, you are not able to update/upgrade your WordPress and plugins to a newer version without providing your FTP connection information. This is a common issue whereby the WordPress system can’t write to your /wp-content folder directly.

Update WordPress via FTP

Update WordPress via FTP

To solve this issue you need to define the FTP details in your wp-config.php file so WordPress will remember it. Add this code to your wp-config.php:

/** Setup FTP Details **/
 define("FTP_HOST", "localhost");
 define("FTP_USER", "your-ftp-username");
 define("FTP_PASS", "your-ftp-password");

Alternatively, you may also provide WordPress with write access to your /wp-content folder by accessing the FTP root file and changing the folder file permission (CHMOD) to 775 rather than the default 755 and 644.

There is however an easier way to deal with this; by defining constant, FS_METHOD in your wp-config.php file. This bypasses WordPress’s recurring prompts, and allows auto-updates of your files to happen. And it takes only 1 line of code to do this. Paste the following code to your wp-config.php file, preferably just below every other line of code.

define('FS_METHOD','direct');

When you have already pasted the one-line code, you can proceed to upload the file to your WordPress root folder on your server, and it should work right away. Uploading can be done directly from your host control panel.

Conclusion

The FTP issue normally happens when you are on shared hosting and when WordPress is having a conflict with permissions and ownerships. With this ‘direct’ method implemented, you will be able to update or upgrade your WordPress and plugins installations to newer versions without having to provide any FTP details.

Leave a Reply

avatar
  Subscribe  
Notify of