Home » wp-content » plugins » Destination Folder Already Exists in WordPress: How to Fix It

Destination Folder Already Exists in WordPress: How to Fix It

You upload a plugin or theme ZIP, or try to reinstall one that broke, and WordPress stops with this:

Installation failed: Destination folder already exists.
/home/user/public_html/wp-content/plugins/plugin-name/

It happens most often after a failed update, a half-finished migration, or when someone copied a plugin over FTP and it never showed up in the Plugins list. The folder is on disk, so WordPress refuses to write into it.

The fix is to move that folder out of the way and install again. Below I show how to do it safely from a file manager, over SSH and with WP-CLI.


Plugin and theme installs go through WP_Upgrader::install_package(). Its abort_if_destination_exists argument defaults to true and clear_destination defaults to false, according to the WordPress code reference.

So if wp-content/plugins/plugin-name/ (or wp-content/themes/theme-name/) already exists and is not empty, the installer deletes the files it just unpacked and returns the folder_exists error. An empty folder does not trigger it.

That is a safety check, not a bug. WordPress does not know whether the files in that folder are a broken copy or something you edited by hand, so it will not delete them for you.

Since WordPress 5.5 you can update an installed plugin or theme by uploading its ZIP, and WordPress offers to replace the current version. In my experience that only works when WordPress recognizes the existing folder as an installed plugin or theme. A leftover folder without a valid main file is invisible to it, so you get the plain error instead.


The error message prints the full path. Open it in your hosting file manager, or over SSH:

cd /home/user/public_html/wp-content/plugins
ls -la plugin-name/

A handful of files with no main PHP file points to a failed or interrupted upload. A complete plugin with a readme and the main PHP file means it is installed, just maybe inactive or not loading.

With WP-CLI you can check whether WordPress sees it at all:

wp plugin list --fields=name,status,version
wp theme list --fields=name,status,version

If the folder name is missing from that list, WordPress does not treat it as a plugin or theme. That explains why the upload screen did not offer to replace it.

Do not delete it yet. Rename it so WordPress ignores it, and keep it until the new copy works. Some plugins keep custom files inside their own folder, and you may need them later.

cd /home/user/public_html/wp-content/plugins
mv plugin-name plugin-name.bak

For a theme it is the same in wp-content/themes. If that theme is the active one, the front end will not look right while it is renamed, so do this when traffic is low.

💡 When the plugin folder is renamed, WordPress deactivates the plugin the next time the Plugins screen loads. After the reinstall, activate it again and check its settings.

With the old folder renamed, the normal upload in Plugins > Add New or Appearance > Themes > Add New will go through.

Over SSH, WP-CLI is faster and has a --force flag. The wp plugin install docs say it overwrites any installed version of the plugin without prompting for confirmation. wp theme install has the same flag.

# from wordpress.org
wp plugin install plugin-name --force

# from a ZIP you uploaded to the server
wp plugin install /home/user/plugin-name.zip --force

# themes work the same way
wp theme install theme-name --force

You should see a success line at the end. If it fails with a permission error instead, the folder belongs to a different user than PHP or WP-CLI runs as. My post on WordPress asking for FTP credentials covers how to fix ownership.

See also  Loopback Request Failed: Fix WP-Cron Status Code 0 in WordPress

Run WP-CLI as the site user, not as root. Files written by root are a common reason the next automatic update fails again.

Once the plugin is active and the site works, delete plugin-name.bak.


WordPress unpacks updates into wp-content/upgrade/ first. Since WordPress 6.3 it also moves the old version of a plugin or theme to wp-content/upgrade-temp-backup/plugins/PLUGINNAME (or /themes/) during a manual update, and puts it back if the update fails, as the 6.3 rollback dev note explains.

That gives you two places worth a look:

  • If an update died halfway and the plugin folder is now broken, check wp-content/upgrade-temp-backup/ first. The previous version may still be there, and you can move it back.
  • Folders inside wp-content/upgrade/ are temporary. When no update is running, you can empty it.
ls -la wp-content/upgrade/ wp-content/upgrade-temp-backup/plugins/ wp-content/upgrade-temp-backup/themes/

An interrupted update can also leave the update lock in the database. If WordPress then says another update is running, clear it as shown in Another update is currently in progress.

If you cannot reach wp-admin at all because the broken plugin crashes the site, disable it first as in Disable WordPress plugins via FTP or phpMyAdmin, then follow the steps above.

In cPanel you rename the folder in File Manager, then upload the ZIP again from wp-admin. In OpenPanel it works the same way: its File Manager manages the files of your domains under /var/www/html/, so you rename the plugin folder there.

If the reinstall then fails on ownership, OpenPanel also has a Fix Permissions tool that makes you the owner of the website files and sets 664 for files and 775 for folders. Its docs warn that custom permissions can be overridden, so keep that in mind if you locked down wp-config.php.

Update plugins from wp-admin or WP-CLI instead of copying folders over FTP. When you have to upload manually, upload the ZIP through WordPress so it can match it to the installed copy.

💡 ZIPs downloaded from GitHub often unpack to plugin-name-main instead of plugin-name. That installs a second copy next to the first, so rename the folder inside the ZIP before you upload it.

If plugin installs also fail with “Could not create directory”, fix permissions first. That case has its own post: Installation failed: Could not create directory.


TL;DR: “Destination folder already exists” means the plugin or theme folder is already in wp-content and is not empty. Rename it to .bak, install again (or run wp plugin install plugin-name --force as the site user), check that everything works, then delete the backup folder.

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended