Error: Failed to connect to FTP Server localhost/WordPress

WP-FTP server

For the purpose of importing data from server to local, there we need to follow the mentioned steps below:

In Dashboard, go to Tools → Import →download the required default plugin.

While downloading the plugin, sometimes it shows an error.

ERROR: To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

SOLUTION:

  • Go to its wp-config.php
  • Add the following code at the bottom of the page:

    define( ‘FS_METHOD’, ‘direct’ );

Leave a comment

Your email address will not be published. Required fields are marked *