How To Fix WordPress Asking For FTP Credentials?


If WordPress is asking for FTP credentials, it typically indicates that the WordPress installation is unable to write to the filesystem. This could be due to incorrect file permissions or ownership issues. Here's a step-by-step guide to fix the issue:

Option 1: Update File Permissions

  1. Access your Hosting Control Panel or FTP Client:
    • Use your hosting control panel or an FTP client (e.g., FileZilla) to connect to your server.
  2. Navigate to the WordPress Installation Directory:
    • Locate the directory where your WordPress is installed.
  3. Update File Permissions:
    • Change the permissions of the WordPress files and directories. You can set directories to 755 and files to 644. Run the following commands in your terminal or through an FTP client:
      • find /path/to/your/wordpress/installation -type d -exec chmod 755 {} \;
      • find /path/to/your/wordpress/installation -type f -exec chmod 644 {} \;
    • Replace "/path/to/your/wordpress/installation" with the actual path to your WordPress installation.
  4. Update Ownership:
    • Ensure that the files are owned by the correct user. Run the following commands:
      • chown -R your_username:your_group /path/to/your/wordpress/installation
    • Replace "your_username" and "your_group" with your actual username and group.

Option 2: Edit wp-config.php

  1. Access wp-config.php:
    • Using an FTP client or the file manager in your hosting control panel, locate and edit the wp-config.php file.
  2. Add FTP Details:
    • Add the following lines to your wp-config.php file:
      • define('FS_METHOD', 'direct');
    • Place this line just before the "That's all, stop editing!" comment.
  3. Save Changes:
    • Save the changes to the wp-config.php file.

Option 3: Set Correct Ownership

  1. Identify Web Server User:
    • Find out the user your web server (e.g., Apache or Nginx) runs as. This can often be found in your server configuration files.
  2. Set Correct Ownership:
    • Set the correct ownership of your WordPress directory to the web server user:
      • chown -R www-data:www-data /path/to/your/wordpress/installation
    • Replace "www-data" with the actual web server user.

Option 4: Check Disk Space

  1. Check Disk Space:
    • Ensure that there is enough disk space available on your server. If the disk is full, it can prevent WordPress from writing to the filesystem.

Option 5: Update WordPress Core

  1. Update WordPress:
    • Ensure that you are using the latest version of WordPress. Outdated versions might have bugs that can cause such issues.

After trying these solutions, try accessing your WordPress admin again. If the problem persists, you may need to contact your hosting provider for assistance or investigate server logs for more specific error messages.

Want this managed for you? Take a look at our managed WordPress Maintenance packages


Was this answer helpful?

One email a month. Endless business benefits.

Don't miss out on WMTWWFY — the newsletter that keeps your website fast, safe, and visible.

« Back
Spinner
aluminium-anthropoid Security Check