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:


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', '' );
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: 2nd July 2021
First published: 22nd August 2019