Prevent WordPress from asking FTP details

Tags:

When installing a new plugin, or upgrading an existing theme, plugin, or WordPress itself, you may be asked for FTP details. But, you say, I thought I had this configured to update directly. Here's how to force WordPress to upgrade without FTP.

In your wp-config.php file, add a line near the top:

define('FS_METHOD', 'direct');

This forces WordPress to write to files directly. Once this is done, you will get error messages that better explain what isn't working.

For example, you may need group write privileges on the wp-content/upgrade directory:

chmod g+w wp-content/upgrade

If you get this error:

Could not remove the old plugin.

you will also need to ensure there is group write on all the plugins themselves:

chmod -R g+w wp-content/plugins