Why WordPress Asks for FTP Credentials
WordPress may prompt for FTP connection details during plugin installation or updates if it doesn’t have permission to write files directly. This often happens on shared hosting or when file ownership is not properly configured.
1. Add FS_METHOD to wp-config.php
The easiest fix is to force direct access. Open wp-config.php and add the following line before the line that says /* That's all, stop editing! */:
define('FS_METHOD', 'direct');
This tells WordPress to use direct file access instead of requiring FTP.
2. Check File and Folder Permissions
Ensure WordPress has permission to write to the wp-content and wp-content/plugins folders.
- Folders:
755 - Files:
644
3. Verify File Ownership
If you’re on VPS or dedicated hosting, make sure the web server (like www-data) owns the WordPress files. This can usually be fixed with:
chown -R www-data:www-data /path/to/wordpress
You may need SSH access or hosting support to do this.
4. Contact Hosting Support
If you’re unable to change these settings, your hosting provider can help configure the proper ownership and permissions.
Need Help?
The WPFix247 team can eliminate this issue by configuring file permissions, ownership, and proper settings, so you can install plugins without any FTP prompts.