> ## Content Index
> Fetch the complete content index at: https://toodlepip.co.uk/llms.txt
> Use this file to discover other available public pages before exploring further.

# Using SSH for WordPress Automatic Updates
- URL: https://toodlepip.co.uk/using-ssh-wordpress-automatic-updates/
- Published: 2013-12-05T12:00:06.000Z
- Updated: 2013-12-05T12:00:06.000Z
- Author: Sam Michel
- Tags: Geekery, #wp, #wp-post, #Import 2026-10-23 15:06

Been a lot of geekery on this blog recently, apologies, triviality and cantankerism to return soon, honest.

Plugins like [SSH-SFTP-Updater-Support](http://wordpress.org/plugins/ssh-sftp-updater-support/installation/?ref=toodlepip.co.uk) provide an easy way to use SSH for plugin, theme and core updates but requires a manual process each time. In its recent release Wordpress 3.7 enabled [automatic background updates](http://codex.wordpress.org/Updating%5FWordPress?ref=toodlepip.co.uk#Automatic%5FBackground%5FUpdates) – no-one wants to wait for a security patch, right?

Came across [this handy code](http://blog.blenderbox.com/2012/10/23/update-wordpress-plugins-over-ssh/?ref=toodlepip.co.uk) for anyone who is running a WordPress installation but using SSH for additional security – never a bad thing – it means updating the core, plugins and themes manually each time. Add a few lines to *wp-config.php* and WordPress should take care of it automatically:

/\*\*  
 \* Cribbed from blog post: http://blog.blenderbox.com/2012/10/23/update-wordpress-plugins-over-ssh/  
 \* Allows WordPress to use SSH without needing an additional plugin  
\*\*/  
define('FS\_METHOD', 'direct'); // 'ssh' is also an option, but did not work for my setup  
define('FTP\_BASE', dirname(\_\_FILE\_\_)); // set this to your docroot  
define('FTP\_CONTENT\_DIR', FTP\_BASE.'/wp-content/');  
define('FTP\_PLUGIN\_DIR ', FTP\_CONTENT\_DIR.'/wp-content/plugins/');  
define('FTP\_PUBKEY', $\_ENV\['HOME'\].'/.ssh/wpkey.pub'); // make sure you've added this as a deploy key before you do this  
define('FTP\_PRIKEY', $\_ENV\['HOME'\].'/.ssh/wpkey');  
define('FTP\_USER', \`whoami\`);  
define('FTP\_HOST', 'localhost:2233'); // or whatever port you're using for SSH

Voila! Seems to the job.

Pic (cc) [Tudor Baker](http://tudedude.co.uk/?ref=toodlepip.co.uk) on [Flickr](http://www.flickr.com/photos/tudedude/4731683872?ref=toodlepip.co.uk).