In WordPress version 2.7 and 2.8, you’ve probably noticed a new feature built into WordPress…FTP updates of plugins. It’s a great new feature and does add a layer of security to the whole process. In the past, you would have to chmod your directories to 777 for this to happen.
Now by providing FTP credentials, you can automatically update your plugins safely and securely. And there are those that worry about the security of storing your FTP password in the config files. Well the fact is your database password is already stored in that same file. In addition, if you think about it, if you had to type your username/password each time into your web-browser, that info is being sent over the net already anyways.
Besides, the FTP method is much more secure on shared servers than using chmod 777 on everything in sight. FTP updates/updating seems to be the way of the future as opposed to using chmod 777, apps like Joomla have already adopted this method.
There is one catch though, if you don’t have passwords and forms saved in your browser, WordPress will ask you for your FTP login credentials every time. If you manage alot of WordPress sites, this can get annoying very quickly.
Thankfully, there’s a simple solution which will save the FTP login (username/password/server) so WordPress stops asking you for them. Here’s how you do it.
1. Locate your WordPress root diectory and find the “wp-config.php” file.
2. Edit the file and insert this somewhere in the middle as it’s own block, we normally put it after the mysql username/password block.
/*** FTP login settings ***/
define("FTP_HOST", "localhost");
define("FTP_USER", "yourftpusername");
define("FTP_PASS", "yourftppassword");Of course you'll want to change "yourftpusername" and "yourftppassword" to the actual FTP usernames/passwords for your site.Once you’ve made that edit, save the file and voila! No more punching in your ftp username and password all the time.
#1 by security locks on August 1st, 2009
Quote
Great content, very helpfull. The web needs more great sites like this.
#2 by glouzy201 on August 25th, 2009
Quote
Like this am not satisfied, because for me, the problem I got is that I know the login and password only for my admin panel, but these informations don’t much with ftp login/password. So my question is Where can I find true ftp login/password for my blog.
please help: (reply on this email: red2zzz-ami@yahoo.fr)
Thnx in advance
#3 by Sil Kogelman on September 18th, 2009
Quote
for extra security you can also add these lines:
//Set to true if your host uses SSL connections
define(‘FTP_SSL’, true);
#4 by Jovan on October 3rd, 2009
Quote
WOW Thanks!! This was so annoying to me because I was always adding and removing plugins and it kept asking me to log my details!
So thanks for your help!!
#5 by whiking on October 7th, 2009
Quote
SPLENDIDO !!
Man Oh man have i been frustrated… works like a charm however one error in the text.
[code]
// ** FTP login settings ** //
define("FTP_HOST", "localhost");
define("FTP_USER", "yourftpusername");
define("FTP_PASS", "yourftppassword");
[/code]
should be
[code]
/** FTP login settings *//
define("FTP_HOST", "localhost");
define("FTP_USER", "yourftpusername");
define("FTP_PASS", "yourftppassword");
[/code]
note that the blank space is removed from / ** ..
//Whiking
#6 by Travis on June 7th, 2010
Quote
Whiking,
You are mistaken. He is using the single line comment type, which is just two slashes. You are changing that comment to the multi-line type, but not removing the trailing slash. Because of this, his original code is valid, but yours is not.
His use of asterisks isn’t in the syntax for PHP comments, just a visual flair.
–TW