Sometimes, when you install & update a WordPress plugin, WordPress will only prompt you for your FTP connection if it cannot write to
directly. In this post, we’re writing about how to install & update WordPress plugins without FTP.
If your web server has write access to the necessary files, it will take care of the updates and installation automatically. This method does not require you to have FTP/SFTP or SSH access, but it does require your to have specific file permissions set up on your webserver.
It will try various methods in order, and fall back on FTP if Direct and SSH methods are unavailable.
WordPress will try to write a temporary file to your
directory. If this succeeds, it compares the ownership of the file with its own uid, and if there is a match it will allow you to use the ‘direct’ method of installing plugins, themes, or updates.
Now, if for some reasons, you do not want to rely on the automatic check for which filesystem method to use, you can define a constant,
file, that is either
'direct', 'ssh', 'ftpext' or 'ftpsockets'
and it will use that method. Keep in mind that if you set this to ‘direct’, but your web user (the username under which your web server runs) does not have proper write permissions, you will receive an error.
Solution to install & update WordPress plugins without FTP
If you do not want to (or you cannot) change permissions on wp-content so your web server has write permissions, then make the changes following the instruction:
- Edit wp-config.php
- Add the code below to the wp-config.php:
<span class="pln">define</span><span class="pun">(</span><span class="str">'FS_METHOD'</span><span class="pun">,</span> <span class="str">'direct'</span><span class="pun">);</span>
- Save & enjoy your install & updates WordPress plugins without ftp!
For more details, refer here.
Don’t hesitate to give the comments below if you have any questions 🙂