Sometimes hosts are really un-helpful and don't set up your Wordpress ftp details for you, or maybe you set your Wordpress install up yourself and Wordpress is asking you for FTP details.
Either way, what you'll quite quickly find, or have already found (hence your now here reading this post) is that downloading plugins is slick when Wordpress just WORKS. When it asks you for FTP credentials everytime, well...that's just annoying.
So how can we stop this? Well it's pretty easy actually.
What you'll need
- Access to editing your wp-config.php file
- Your host's FTP or SFTP details
Open up your wp-config.php file, found in the root of your Wordpress install.
Add the following if you just want standard FTP connection.
define('FS_METHOD', 'ftpext'); define('FTP_BASE', '/home/site-name/www/'); define('FTP_CONTENT_DIR', 'wp-content'); define('FTP_PLUGIN_DIR ', 'wp-content/plugins/'); define('FTP_USER', 'yourFTPUsername'); define('FTP_PASS', 'yourFTPpassword'); define('FTP_HOST', 'yourFTPhost'); define('FTP_SSL', false);
To connect with SFTP then all you'll need to do is add to the above, the following definitions and add your credentials paths.
define('FTP_PUBKEY', '/home/username/.ssh/id_rsa.pub'); define('FTP_PRIKEY', '/home/username/.ssh/id_rsa');
Trust me when I say this, when Wordpres just WORKS. It is a great experience!