It is little annoying when WordPress asks for your FTP credentials like Host name, FTP username, FTP password, Connection-type etc. while installing a new plugin or updating a plugin. If you do not remember your FTP credentials, you need to contact your web host. Well, there are simple ways to avoid this scenario. I am writing this article to elaborate the ways to Skip FTP Credentials Window which appears as shown below in WordPress.
Skip FTP Credentials Window in WordPress :
1. Change Access Permission of wp-content folder to 777:
You can provide WordPress with write access to your /wp-content folder by accessing the FTP root file and changing the folder file permission (CHMOD) to 777 rather than the default 755 and 644. This option may cause security issues as the file permission 777 makes the folder writeable. I would recommend to follow the 2’nd option as suggested below.
2. Update WordPress wp-config.php file with FTP details :
Step 1 : Open up your wp-config.php file for editing and add the following lines to it anywhere. Replace the default values like username,password,etc with your FTP login information.
define( 'FS_METHOD', 'ftpext' ); define( 'FTP_BASE', '/path/to/wordpress/' ); define( 'FTP_USER', 'username' ); define( 'FTP_PASS', 'password' ); define( 'FTP_HOST', 'ftp.example.org' ); define( 'FTP_SSL', false );
Step 2 : Save your file and upload it back to your site. Now this will Skip FTP Credentials Window in WordPress.
I have explained above constants for WordPress updates which are sufficient for our requirements. There are other additional constants as well as listed below, If needed you can go through these :
FS_METHOD forces the filesystem method. It should only be “direct”, “ssh2”, “ftpext”, or “ftpsockets”. Generally, you should only change this if you are experiencing update problems. If you change it and it doesn’t help, change it back/remove it. Under most circumstances, setting it to ‘ftpsockets’ will work if the automatically chosen method does not.
FTP_BASE is the full path to the “base”(ABSPATH) folder of the WordPress installation.
FTP_USER is either user FTP or SSH username. Most likely these are the same, but use the appropriate one for the type of update you wish to do.
FTP_PASS is the password for the username entered for FTP_USER. If you are using SSH public key authentication this can be omitted.
FTP_HOST is the hostname:port combination for your SSH/FTP server. The default FTP port is 21 and the default SSH port is 22. These do not need to be mentioned.
With all above constants you can edit the wp-config.php file with the following code :
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 );
I hope you find this article helpful. If you have any query or suggestions about how to Skip FTP Credentials Window in WordPress, do share with us.