Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Fix WordPress FTP Connection Problems: Step-by-Step

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

If your WordPress site asks for FTP credentials when you try to install plugins, themes, or updates, it means the web server can’t write files directly to your hosting account. This guide walks you through the most common fixes, from simple file permission changes to editing your wp-config.php file. You’ll need access to your hosting control panel (like cPanel) and an FTP client such as FileZilla, or at least the ability to use your hosting file manager.

What You'll Need

  • WordPress admin login credentials
  • Hosting control panel access (cPanel, Plesk, or similar)
  • FTP client (FileZilla, Cyberduck) or hosting file manager
  • FTP hostname, username, and password (usually provided by your host)

Step-by-Step

  1. Back up your site. Before changing any files or permissions, create a full backup of your WordPress files and database. Most hosts offer a one-click backup in their control panel, or you can use a plugin like UpdraftPlus.
  2. Check your file permissions. Connect via FTP or open the file manager. Navigate to your WordPress root folder (often public_html or www). All directories should be set to 755 and all files to 644. Right-click a folder, select “File permissions,” and set the numeric value. Apply recursively to all subdirectories and files. Incorrect permissions (like 777) can trigger the FTP prompt.
  3. Verify the ownership of files. On most shared hosts, files should be owned by your cPanel username, not “root” or “nobody.” If you see the wrong owner, you may need to contact your host to change it, or use the “Change Owner” option in some file managers.
  4. Add FTP constants to wp-config.php. Open your wp-config.php file (in the root directory) and add the following lines just before the “That’s all, stop editing!” comment:
    define('FS_METHOD', 'direct');
    This tells WordPress to write files directly using the PHP process, bypassing FTP. Save the file and try installing a plugin again.
  5. If the direct method fails, try FTP constants. If you still get the FTP prompt, you can provide your FTP details in wp-config.php instead:
    define('FTP_HOST', 'ftp.yourdomain.com');
    define('FTP_USER', 'your_ftp_username');
    define('FTP_PASS', 'your_ftp_password');
    Replace the placeholders with your actual FTP credentials. This is less secure than the direct method, so only use it temporarily.
  6. Check your hosting plan’s PHP version. Some older PHP versions can cause file permission issues. In your hosting control panel, look for “Select PHP Version” or “MultiPHP Manager.” Switch to a supported PHP version (like 7.4 or 8.0) if you’re on an older one. Then repeat step 4.
  7. Disable security plugins temporarily. Some security plugins (like Wordfence or iThemes Security) can block file writes. Deactivate them from the WordPress admin, try the update again, and re-enable them if the fix works.
  8. Contact your hosting provider. If none of the above works, the issue may be on the server side. Ask them to check file ownership and permissions, and confirm that mod_rewrite and PHP write access are enabled for your account.

Common Mistakes

  • Setting permissions to 777. This is a security risk and many hosts block it. Use 755 for directories and 644 for files.
  • Editing the wrong wp-config.php. Make sure you’re editing the file in the root directory, not a subfolder or a backup copy.
  • Forgetting to clear cache. After changing permissions or wp-config.php, clear any caching plugins and your browser cache to see the changes.
  • Using the wrong FTP hostname. Some hosts use ftp.yourdomain.com, others use localhost or a specific server address. Check your welcome email.

Tips

  • Always use the direct method if possible. It’s faster and avoids storing FTP passwords in plain text.
  • Keep your WordPress, themes, and plugins updated to avoid compatibility issues that can cause file permission problems.
  • If you’re on a managed WordPress host (like WP Engine or Kinsta), you usually don’t need FTP at all—contact their support if you see this prompt.
  • Use an FTP client with a “recursive” permission change option to avoid missing subfolders.

Troubleshooting

If you’ve followed the steps and still see the FTP prompt, try these additional checks:

  • Check if the wp-content folder is writable. The most common cause is that wp-content (or its subfolders like plugins and themes) is not writable. Try changing permissions on just those folders to 755.
  • Look for a .maintenance file. If a previous update failed, a .maintenance file may be left in the root. Delete it via FTP.
  • Verify the correct path. If your WordPress is installed in a subdirectory (like /blog), you need to apply permissions to that subdirectory, not the parent.
  • Try a different browser or incognito mode. Sometimes cached pages show old errors. Log out and log back in.
  • Check your hosting’s error logs. In cPanel, look for “Errors” or “Raw Access Logs.” PHP errors can reveal why file writes are failing.

Frequently Asked Questions

Why does WordPress ask for FTP credentials even though I have correct file permissions?

This usually means the PHP process runs as a different user than the file owner. The FS_METHOD constant set to direct forces WordPress to use the PHP user, but if that user doesn’t have write permissions, you’ll still see the prompt. Check file ownership with your host.

Is it safe to set FS_METHOD to 'direct'?

Yes, it’s generally safe and is the recommended method for most sites. It simply tells WordPress to use the filesystem directly instead of FTP. However, you should still ensure your file permissions are not overly permissive (like 777).

What does the FTP hostname look like?

It’s often ftp.yourdomain.com or localhost. Some hosts use a specific server name like server123.hostingco.com. Check your hosting welcome email or support documentation.

Can I use FTPS (FTP over SSL) with WordPress?

Yes, you can add define('FTP_SSL', true); to your wp-config.php if your host supports FTPS. This encrypts the FTP connection for better security.

Why do I still get the FTP prompt after adding the constants?

If you added the constants but didn’t save the file correctly, or if your hosting has special restrictions (like a read-only file system), the constants may be ignored. Double-check the file is saved in UTF-8 without BOM, and contact your host if the issue persists.

Will changing file permissions break my site?

If you set directories to 755 and files to 644, your site should work fine. Setting them to 777 can be a security risk, and setting them too low (like 600) can cause white screens or other errors.