Configure WordPress to store FTP details

Hate having to type your server FTP details when upgrading WordPress? Would you like WordPress to remember your FTP login details? then read on…

Anybody familiar with WordPress will know that when adding/removing or upgrading any of your plug-ins, even upgrading the WordPress itself, you are prompted for the FTP connection details for your server, while not a big or frustrating step, it can be a pain if you don’t have the details to hand or want others to install plugins or be able to upgrade your blog to ensure its secure but not give them the login details for the server.

The answer is surprisingly a simple one, you don’t need to install one of the various FTP Saver plug-ins and spend hours trawling through the code, and any updates, to check your details will be secure, all you have to do is add a few extra lines to your wp-config.php file by defining the connection details, WordPress will do the rest.

The constants should be defines as follows,

/** Store Server FTP Details */
define("FTP_HOST", "domain.tld");
define("FTP_USER", "username");
define("FTP_PASS", "password");

Once you have saved the config file, all you need to do is test it…

Tags:

Enough of me, let me know your thoughts below...

  1. Anthony Rome Anthony Rome says:

    Thanks for this, quite helpful!

  2. Matt Fryer Matt Fryer says:

    Does anybody know how WordPress ensures that the wp-config file is secure? Apologies if this is a vague question but I would just like to know how to store important details such as ftp and database credentials securely, I understand how to write a php config file but not how to secure it. Many thanks

  3. Simon Dalley Simon Dalley says:

    Great bit of advice there – I have a site that I’m still typing the FTP details into (and always seem to forget them!)

  4. Gavin Gavin says:

    Hi Mark,

    no you don’t need to specify a directory, WordPress transfers the updated files into its own temp directory before moving them to their required folder(s)

  5. Mark Lewis Mark Lewis says:

    Hello.

    How do I (do I need to) define the directory into which the install files will be put?

    Thanks

  6. flash flash says:

    Seems like this post is catching, with some extra bonus tips too

    http://digwp.com/2010/11/ftp-in-wpconfig/

    You were still the first though Gav 😉

  7. glouzy201 glouzy201 says:

    Hey, can some one tell me how to create or to get FTP details in wordpress.com blog, I thank you in advance

  8. Giles Smith Giles Smith says:

    Good to see this, they don’t make it very obvious on the wordpress site!