How to Add or Change FTP Details for Easy WordPress Upgrades

If your WordPress site has recently been moved or if you have changed your FTP password, you may be continually prompted for your details within the dashboard. This can be quite annoying if you’re upgrading or installing new plugins and themes. Did you know that there’s a way to set these FTP details so that WordPress will never ask you again? It’s very easy and should save you a lot of time if you are struggling with with those auto-prompts.

How to Set Your WordPress FTP Details in wp-config.php

Step 1: Check Your FTP Username / Password.

You’ll want to make sure you’ve got the correct information before inputting it into wp-config.php. Visit your hosting control panel to verify your FTP hostname, username and password.

Step 2: Add the FTP Details to wp-config.php

You’ll want to specify the details for your connection and then add them in the wp-config.php file:

define('FTP_USER', 'username');
define('FTP_PASS', 'password');
define('FTP_HOST', '');

This should correct and update your FTP details with WordPress so that you can be on your merry way with upgrades and new plugin and theme installs. If you want to use a secure connection, you can add this:

define('FTP_SSL', true);

Sometimes you may experience issues because your WordPress installation is not in the root directory of the FTP server. In that case you’ll want to define the path to the base directory, content directory and the plugin directory:

define('FTP_BASE', '/path/to/wordpress/');
define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/');
define('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/');

More than likely you won’t need to do all of the above. There are a number of WordPress Upgrade Constants listed in the codex, but you should only define as many of them as are necessary. There’s no need to go wild and put in all of them. Just the basic FTP details should be good enough to make your upgrades quick and easy.


Comments (4)

  1. Sometimes it can be a permissions issue – depends on the error you’re getting. If you’re just getting the nagging prompt to enter FTP details every time, this should fix that. :)

  2. That might solve some users a real issue where they can’t (or don’t know how to) sort permissions.
    But if you do so you’d better move wp-config.php outside the web root… Well anyway should always be outside as exposing on top of DB details the FTP access is just free treats for hackers ;-)
    (in “details”: no wp-config in “www” or “public_html” but up this where it’s not accessible and WP does support one level up by default! For the ones having blog under a subdirectory like “/blog/” you can still do this and keep a wp-config.php that just make an include to the hidden file…)

    I think each suggestion on wp-config.php should be the occasion to remind such basic security to all ;-)