Fix “Destination folder already exists” when installing plugins/themes
If you’ve ever tried to install a plugin or theme in WordPress and encountered the error “Destination folder already exists”, you know it can be frustrating. This error prevents WordPress from unpacking and installing the new plugin or theme because a folder with the same name already exists on your server. The quick fix is to delete or rename the existing folder before retrying the installation.
Quick Fix
- Access your website’s files via FTP, SFTP, or your hosting control panel’s file manager.
- Navigate to
wp-content/plugins
for plugins orwp-content/themes
for themes. - Locate the folder named exactly as the plugin or theme you are trying to install.
- Delete or rename this folder (e.g., add
-old
to the folder name). - Return to your WordPress dashboard and retry the plugin or theme installation.
Why this happens
WordPress installs plugins and themes by unpacking a ZIP archive into a folder inside wp-content/plugins
or wp-content/themes
. If a folder with the same name already exists, WordPress cannot overwrite it and throws the “Destination folder already exists” error.
This can happen if:
- A previous installation or update failed and left files behind.
- You manually uploaded the plugin or theme folder before.
- A plugin or theme folder was not properly deleted.
- File permissions or ownership issues prevent WordPress from removing the folder.
Step-by-step: Fix on Nginx/Apache with cPanel/Plesk
1. Access your server files
Use one of the following methods to access your WordPress files:
- FTP/SFTP: Connect with an FTP client like FileZilla using your hosting credentials.
- cPanel File Manager: Log in to cPanel, go to File Manager.
- Plesk File Manager: Log in to Plesk, navigate to Files.
2. Navigate to the plugin or theme folder
cd public_html/wp-content/plugins
# or for themes
cd public_html/wp-content/themes
3. Identify the conflicting folder
Look for the folder with the same name as the plugin or theme you want to install. For example, if installing “my-plugin”, look for a folder named my-plugin
.
4. Delete or rename the folder
To delete the folder via command line (if you have SSH access):
rm -rf my-plugin
If you use cPanel or Plesk File Manager, right-click the folder and select Delete or rename it to my-plugin-old
.
5. Check file permissions (optional)
Ensure WordPress can write to the plugins/themes folder:
chmod 755 wp-content/plugins
chmod 755 wp-content/themes
If ownership is an issue, contact your hosting provider or set ownership to the web server user (e.g., www-data
on Ubuntu):
chown -R www-data:www-data wp-content/plugins
chown -R www-data:www-data wp-content/themes
6. Retry plugin/theme installation
Go back to your WordPress dashboard and install the plugin or theme again. The error should no longer appear.
Works on
Server | Control Panel | Notes |
---|---|---|
Apache | cPanel, Plesk | Standard file permissions and ownership apply. |
Nginx | cPanel, Plesk | Same fix applies; ensure correct user ownership. |
LiteSpeed | cPanel, Plesk | Compatible with same file management steps. |
FAQ
- Q1: Can I just overwrite the existing folder instead of deleting it?
- A1: WordPress does not overwrite existing folders during installation. You must delete or rename the folder first to avoid conflicts.
- Q2: What if I don’t have FTP or file manager access?
- A2: Contact your hosting provider’s support to assist with deleting or renaming the conflicting folder.
- Q3: Could this error be caused by file permission issues?
- A3: Yes. If WordPress cannot delete or overwrite folders due to permission problems, you may see this error. Fix permissions or ownership as shown above.
- Q4: Is it safe to delete the existing plugin or theme folder?
- A4: Only delete if you are sure the folder is from a failed or old installation. Back up your site if unsure.
- Q5: How can I avoid this error in the future?
- A5: Always delete plugins or themes from the WordPress dashboard instead of manually removing files. Ensure updates complete successfully.