Solving WordPress Asking for FTP Credentials When Installing Plugins or Themes

Published by Manan Patel on

Most web hosting is configured to automate installing of theme or plugins. On some hosting WordPress ask for FTP details either to update or install a theme or Plugin.

To fix this issue we can enter our FTP credentials in wp-config.php file so that we don’t have to enter it every time we update a plugin.

It also helps in new automatic update feature introduced by WordPress.

Enter following code in wp-config.php file:

define('FTP_USER', 'username');
define('FTP_PASS', 'password');
define('FTP_HOST', 'ftp.mananpatel.in:21');

Where

  • username is ftp username.
  • password is ftp password.
  • ftp.mananpatel.in is ftp hostname and 21 is port number.

Alternatively, We can also override default file and directory permission by entering following lines in wp-config.php

define( 'FS_CHMOD_FILE', 0644 );
define( 'FS_CHMOD_DIR', 0755 );
Where
  • FS_CHMOD_FILE is file permission &
  • FS_CHMOD_DIR is directory permission.

Happy Coding 😉


Leave a Reply

%d bloggers like this: