DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

If you often install, delete or upgrade plugins or themes, you might be annoyed that WordPress asks for your FTP credentials every time. Here is a simple code snippet to change the filesystem method and make sure WordPress won’t ask for your FTP login and password again.

Paste the following line in your wp-config.php file. This file is located in the root of your WordPress install.

define('FS_METHOD', 'direct');

Please note that the code snippet provided above might not work on all hosting providers, and might even cause security issues if your host is badly configured, so avoid using it if you’re not sure about your hosting.

I use VidaHost on WPRecipes and my other blogs. WP Web Host is also good for smaller websites.

Thanks to WP Tuts+ for the cool tip!


  1. It’s the same as put these lines in wp-config.php ? :
    define(‘FTP_HOST’, ‘localhost’);
    define(‘FTP_USER’, ‘user’);
    define(‘FTP_PASS’, ‘pass’);

  2. Thanks from another Vidahoster!

  3. Thank you for this. I tried so many solutions for a highly secured hosting provider and nothing worked until this snippet.

    I’ve tried even what @nono asked and that one didn’t work either.

  4. I had a similar issue with my host, WiredTree. I contacted support and they had to make some permission/file system changes to prevent this from happening. Its very frustrating to have to enter this everytime.

  5. This was annoying actually. Thanks to this piece of code. Why does this get displayed? I am using a dedicated server now. Previously when I was on shared hosting, I never got this.

  6. Does it works?
    No for me,Yes it doesn’t asks for FTP details anymore,but neither it deletes the file properly.
    I have checked File Permissions but it doesn’t helps me.

Leave a Comment

Your email address will not be published. Required fields are marked *