Auto-Update WordPress Without FTP Credentials

Updating or upgrading your WordPress and plugins can be troublesome if you’re asked for FTP connection details. This often happens when WordPress can’t directly write to your /wp-content folder.

You can address this by adding FTP details to your wp-config.php file. Alternatively, granting write access directly to the /wp-content folder by changing its permissions to 775 (from the default 755 or 644) through FTP can also solve this problem.

A simpler method involves defining a constant, FS_METHOD, in your wp-config.php file. This single line of code bypasses the need for FTP details and enables automatic updates.

How to SSH into Server Without Password

How to SSH into Server Without Password

In this post, I'll show you how to bypass the password prompt and get you connected to your... Read more

Open wp-config.php File

First, locate and open the wp-config.php file in the root directory of your WordPress installation (accessible via your WordPress installer folder).

Add FS_METHOD Code

Add the following line at a suitable place in your wp-config.php file:

define('FS_METHOD','direct');
Illustration of adding FS_METHOD in wp-config.php

Save Changes and Upload

After inserting the code, save the file and upload it back to the root directory on your server using your hosting control panel.

Conclusion

FTP issues are common in shared hosting environments due to permission and ownership conflicts. By implementing the ‘direct’ method, you can seamlessly update or upgrade your WordPress and its plugins without entering FTP details.

WebsiteFacebookTwitterInstagramPinterestLinkedInGoogle+YoutubeRedditDribbbleBehanceGithubCodePenWhatsappEmail