Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Wordpress - Allow Automatic Security Updates When Using SFTP Plugin

If you use the SFTP plugin to allow updating using SSH rather than FTP, and you wish to allow Wordpress to automatically apply security updates, or to be able to install plugins/themes without constantly having to enter the username/password, then do the following:

Steps

Edit your wp-config.php file and add the following settings:

// SFTP (SSH) details for automatic updates
define( 'FTP_USER', 'sshUsernameHere' );
define( 'FTP_PASS', 'sshPasswordHere' );
define( 'FTP_HOST', '127.0.0.1:22' );
define( 'FS_METHOD', 'ssh2' );

If you use FTP instead, you should be able to just comment out the last line (in theory, not tested).

Last updated: 4th October 2019
First published: 22nd August 2019