Wordpress Asking For Ftp Credentials

How To Fix WordPress Asking For FTP Credentials (3 Methods)

Is your WordPress asking for FTP credentials continuously when you are trying to add plugins from the admin panel?

Don’t worry, you are not alone.

Thousands of WordPress users are facing the same issue of WordPress asking for FTP credentials including us. So, in this tutorial, we will show how to solve this issue with ease.

The error looks something like this:

How To Fix Wordpress Asking For Ftp Credentials (3 Methods)

Some common reasons for the issue may appear on your WordPress site.

  1. You have initiated an update recently
  2. You have installed a new theme or plugin.
  3. Your WordPress has insufficient permissions to modify files on your server.

3 Solutions To WordPress Asking For FTP Credentials

We are going to provide three easy solutions to this problem, Two of which will require you to edit the wp-config.php file in your site which is located on the root directory of your WordPress site.

You can access this file by using an FTP client like FileZilla, or by using the file manager in your web hosting control panel.

The last one is required to run a command using SSH on your server. Or, you can also complete the task from your file manager too.

Method 1: Force Direct Filesystem Method

This method is very simple. You just need to add the following code to your wp-config.php file. You will find this in your public_html, ie, WordPress root directory.

define('FS_METHOD','direct');

This method forces WordPress to use the “direct” PHP functions for automatic updates, rather than utilizing the FTP protocol.

After pasting the code on your wp-confiq.php file press the Save button and try to install any plugin from the admin panel.

If the method works for you properly, then you are good to go.

Otherwise, remove the code from wp-config.php and you are welcome to use the second method.

Method 2: Add the FTP Credentials To wp-config.php

You are reading the second method, this means the first method can’t solve the issue for you. In this method, you will need to provide your FTP access to WordPress. So that, it can install plugins or themes using FTP credentials without promoting FTP access.

This method is very simple too. You just need to add the following code to your wp-config.php file.

define('FTP_USER', 'USERNAME');
define('FTP_PASS', 'PASSWORD');
define('FTP_HOST', 'FTP.EXAMPLE.COM');

Here, you need to change the username, password, and host with your own details. If you don’t have the above credentials then you can contact your hosting provider for the credentials.

Once you’ve added the given code on your wp-config.php file, save the file and reattempt to install a plugin using your WordPress dashboard. I Hope, It should work now!

If this method is also unworthy for you, then please try the third method. This should work.

Again, remove the code from wp-config.php move forward to use the last method.

Method 3: Change file owner of the public_hlml life

These days Ubuntu users are facing this issue of WordPress asking for FTP credentials frequently. If you are running the Ubuntu operating system on your server then the owner of your WordPress root directory may be the main culprit.

You need to change the ownership of the wordpress folder to www-data recursively and restart apache.

Run the below command one by one to solve the issue.

sudo chown -R www-data:www-data <folderpath>
sudo service apache2 restart

After restarting the apache login to your WordPress dashboard and try to download plugins.

Note: Read more tutorials like this from here

Conclusion

We hope this quick guide helped you to solve your issue of WordPress asking for FTP credentials when trying to automatic update and download plugins and themes.

If you have any questions or run into any issues along the way, please feel free to leave a comment below!

That’s all in this tutorial. Thank you for reading.

Meaningful sharing changes the world. If this article is helpful then don’t forget to share. Have a great day.

Boost Your Site With Our SEO Tips

Avatar Of Geeky Staff

About the Author: Geeky Staff

The geeky staff has long-term experience with Linus server management and web development & like to share solutions with geeky questions. We believe you don't need to be a nerd or a programmer or a network engineer to make a difference.

Leave a Reply

Thanks for choosing to leave a reply. Your opinions and comments are very important to us, and your email address will NOT be published. If you need a private conversation then use our contact form.

Share this post »



Visual-composer-banner

Thanks for Subscribing!

 

We’ve sent you an email with a coupon code link at the email address you provided that will help you create your own blog 🙂

 


 

You may also want to join our free HiGeeky Engage group on Facebook.

Join HiGeeky Engage Group (It’s Free)

Disclaimer

Hi geeky, We are using affiliate links & images from respective product sites in our articles occasionally, means that if you click on one of the links and purchase an item, we may receive a commission (at no additional cost to you). All the reviews & opinions (positive or negative) are 100% our own. We are not getting any money to write them. The trademarks mentioned in this website belong to the respective companies. All the articles are information purpose only, to help someone to educate & save money. In case any problem with the content, you can reach us anytime through our contact us page »