Is it possible to force wordpress to always request for FTP credentials when installing and updating plugins / themes? I know the ftp credentials input is bypassed if wordpress has enough unix user access, but i want wordpress to ask nevertheless. Is this possible? How?

  • I don't give this as an answer because it might cause some issue with cache plugins but in your case you could just change /wp-content/ rights. It the server does not have write permissions it will ask for credentials – JMau Jul 30 '13 at 21:09
  • remove write access to /wp-content/? It will break media uploads too, won't it? And some other plugins/themes need write access to certain files for dynamic .css for example – reikyoushin Jul 30 '13 at 21:12
  • My goal is just to make sure a user has FTP credentials first before uploading anything on the wp admin.. (I would have disabled theme editor already, so the only thing left is the wp theme/plugin install) – reikyoushin Jul 30 '13 at 21:15
  • I wouldn't edit my theme via wp-admin anyway so I really don't need it.. – reikyoushin Jul 30 '13 at 21:16
  • no there's maybe /upgrade/ too, be careful with this technique anyway or wait for an answer – JMau Jul 30 '13 at 21:17

I just tried this on a local install that previously used the 'direct' FS_METHOD.

In wp-config.php, set the following constants:

define('FS_METHOD', 'ftpext');

Not sure if this actually affects things, but I also set these to try to force the input fields to be empty when the form is presented:

define('FTP_USER', false);
define('FTP_PASS', false);

Source: http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants

  • Hi, it's working alright, but why do you need to specifically put define('FTP_USER', false); and define('FTP_PASS', false);? I tested just adding define('FS_METHOD', 'ftpext'); and it works already.. But since i've got the idea from you.. you get the credits. thanks! – reikyoushin Jul 30 '13 at 21:25
  • Now I wonder why people don't use this for security purposes.. o.O? – reikyoushin Jul 30 '13 at 21:38
  • I think if you just don't add them it'll still work. I added them to try to explicitly force the fields to be empty when the form is presented to the user. – Morgan Estes Jul 30 '13 at 21:59
  • maybe you can edit it to specify that it is optional? well. thanks a lot. – reikyoushin Jul 30 '13 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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