I am trying to update some plugins on a WordPress site. To do this directly through WordPress you need to provide:

  • Hostname
  • Username
  • Password
  • Connection yype

I am definitely using the correct details however they are being refused.

An error is displayed:

ERROR: There was an error connecting to the server, Please verify the settings are correct.

There is a thread on the WordPress forum asking similar question but there is no answer.

I have tried using my regular hostname in addition to localhost, localhost:21 and localhost:22.

Does anyone have any suggestions how to make this work correctly?

  • are you using passive ftp? if so, does your server accept passive ftp? Commented Apr 15, 2014 at 14:14
  • I believe it is using active mode.
    – slaterio
    Commented Apr 16, 2014 at 8:23
  • @TripleAntigen Thank you so much for this post. I installed the 'SSH SFTP Updater Support' pkg and Voila! I have been searching for a solution to this upgrade with my Host for months now. This fix took seconds. Give it a try if you are having trouble. I only needed to select the SSH2 option and enter my credentials that I was beginning to think were invalid! Thanks again.
    – iAmCrafty
    Commented Feb 6, 2015 at 18:00
  • If you are using AWS, make sure you specify the private IP of the server, not the public IP, because you cannot reach the public IP from the server.
    – user71263
    Commented Oct 22, 2016 at 3:54

4 Answers 4


If it were a folder permission error you would connect but get an error about permissions.

First enable WP_DEBUG in wp-config

If you have root access, check your php error log, and syslog in /var/log

From a shell, try FTPing to localhost does it work? Can you read and write to your plugins folder? Now also try from a remote machine FTPing into the server and again checking your read/write permissions.

Try setting the FTP details in wp-config

define( 'FS_METHOD', 'ftpext' );
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/' );
define( 'FTP_PUBKEY', '/home/username/.ssh/id_rsa.pub' );
define( 'FTP_PRIKEY', '/home/username/.ssh/id_rsa' );
define( 'FTP_USER', 'username' );
define( 'FTP_PASS', 'password' );
define( 'FTP_HOST', 'ftp.example.org' );
define( 'FTP_SSL', false );


Figure out why you can't connect first. Then move on to folder permissions which is much easier to debug.

If you still have trouble just use this plugin http://wordpress.org/plugins/ssh-sftp-updater-support/

Keeping your WordPress install up-to-date and installing plugins in a hassle-free manner is not so easy if your server uses SFTP. "SSH SFTP Updater Support" for WordPress uses phpseclib to remedy this deficiency.


I had the same problem, I found a number of solutions in various forums, none of which helped. My credentials were OK but they were being rejected; they worked in Filezilla.

Somewhere I found a reference to a small plugin called 'SSH SFTP Updater Support', which fixed my problem. After installing this the option for SFTP is added and you can choose SSH2 when being challenged for the FTP login details.

Choose SSH2 at the bottom; and I didn't have to fill in anything in the private key box. Plugin deletion worked normally after that.

enter image description here


Check your file and folder permissions and set them to the correct ones. Have a look here. http://www.electronicworkplace.com/latest-updates/wordpress-correct-permissions-for-files-and-folders If you have the correct permissions then it won't ask you for ftp details.

If that doesn't work perhaps you have an ownership problem.

The other way to update is to manually upload the plugins to the plugins directory and update it that way.

  • Thanks for the link. My permissions were fine except for .htaccess file which I've now changed. I've eventually uploaded the individual plugins manually. Looking into ownership issues now.
    – slaterio
    Commented Apr 16, 2014 at 8:20
  • @slaterio any luck?
    – Abu Nooh
    Commented Apr 16, 2014 at 22:43
  • I haven't uncovered anything unusual in the settings/permissions yet.
    – slaterio
    Commented Apr 21, 2014 at 13:51
  • If you have a VPS and WHM make sure you're using suphp instead of DOS. That will get rid of all your file permission issues.
    – gdaniel
    Commented May 16, 2014 at 16:36
  • @AbuNoohThis link Broken.Please fix this Commented Mar 5, 2020 at 8:44

Had the same issue, this page help me resolve it.

The cause of my issue is a file ownership issue.

Just make sure the files are owned by the correct owner/group

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.