How to fix WordPress asking for FTP credentials

When you try to install or update a plugin or theme in the WordPress dashboard and are prompted to enter your FTP credentials, it’s due to a specific setting in the wp-config.php file. This guide provides detailed steps to resolve this issue, allowing you to manage your plugins and themes without entering FTP credentials.

Table of Contents

  1. Introduction
  2. Prerequisites
  3. Steps to Prevent FTP Prompt
  4. Conclusion

Introduction

WordPress may ask for FTP credentials when you try to update or install plugins and themes. This is often due to WordPress not having the correct file permissions to write to the wp-content directory. By modifying the wp-config.php file, you can configure WordPress to use direct file system access, bypassing the need for FTP credentials.

Prerequisites

  • Access to your hosting account (via FTP or File Manager).
  • Basic understanding of editing files on a web server.

Steps to Prevent FTP Prompt

Step 1: Connect to Your Hosting Account

Use an FTP client (like FileZilla) or your hosting provider’s File Manager to connect to your hosting account.

Step 2: Locate the wp-config.php File

Navigate to the directory containing your WordPress installation. This is typically the root folder of your website. Look for the wp-config.php file.

Step 3: Modify the wp-config.php File

Open the wp-config.php file in a text editor. Scroll to the bottom of the file, and just above the line that says /* That's all, stop editing! Happy publishing. */, add the following lines of code:


define('FS_METHOD', 'direct');

These lines configure WordPress to use direct file system access and set the appropriate permissions for directories and files.

Step 4: Save the Updated File

Save the changes to the wp-config.php file and close the text editor.

Step 5: Reload Your WordPress Dashboard

In your web browser, reload the WordPress dashboard. You should now be able to update or install plugins and themes without being prompted for FTP credentials.

Conclusion

By following these steps, you can configure WordPress to manage plugins and themes without needing to enter FTP credentials, streamlining your workflow and improving efficiency. This solution modifies the file system method used by WordPress, ensuring it has the necessary permissions to perform updates and installations directly.

Leave a Comment