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
- 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.
- Navigate to the WordPress Installation Directory:
- Locate the directory where your WordPress is installed.
- 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.
- 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:
- 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.
- Ensure that the files are owned by the correct user. Run the following commands:
Option 2: Edit wp-config.php
- Access wp-config.php:
- Using an FTP client or the file manager in your hosting control panel, locate and edit the
wp-config.phpfile.
- Using an FTP client or the file manager in your hosting control panel, locate and edit the
- Add FTP Details:
- Add the following lines to your
wp-config.phpfile:define('FS_METHOD', 'direct');
- Place this line just before the "That's all, stop editing!" comment.
- Add the following lines to your
- Save Changes:
- Save the changes to the
wp-config.phpfile.
- Save the changes to the
Option 3: Set Correct Ownership
- 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.
- 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.
- Set the correct ownership of your WordPress directory to the web server user:
Option 4: Check Disk Space
- 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
- 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