ERROR · 33 · VERIFIED 2026-10allwpcare.com/errors/installation-failed-destination-folder-already-exists/
Errors / installation-failed-destination-folder-already-exists

Installation Failed: Destination Folder Already Exists

A folder with this name already holds files in wp-content/plugins. Use Replace current with uploaded, or move the old folder out of plugins and install again.

The message you see
1−Installation failed: Destination folder already exists.
Last verified Oct 2026Tested with WordPress 7.1Applies to WordPress 7.1 (tested) · PHP 7.4+

Why it happens

  • The plugin or theme is already installed, and you uploaded its zip again or clicked Install Now on it.
  • A folder with files was left behind, for example by a delete that did not finish or a manual copy. It is not a working plugin, so it never shows on the Plugins screen.
  • You copied or renamed a plugin folder by hand, for example with FTP, and its name now matches the one you want to install.

How to fix it

Try the fixes in this order. Each one is independent: stop as soon as the error is gone.

FIX 01

Upload the zip and choose Replace current with uploaded

  1. Use this when the plugin is installed and you want the version in the zip. Go to Plugins → Add Plugin → Upload Plugin, choose the zip and click Install Now.
  2. If the folder holds a plugin WordPress knows, the page prints "This plugin is already installed." and a table with the Current and Uploaded version. Click Replace current with uploaded.
  3. For a theme, the same screen is under Appearance → Themes → Add Theme → Upload Theme and the button says Replace installed with uploaded.
  4. This works for a plugin and a theme. An active plugin stays active after the replace.
  5. Back up first. WordPress deletes the old folder before it moves the new one in, so any file you added inside it is gone.
FIX 02

Look inside the folder before you touch it

  1. Use SFTP, your host's file manager, or SSH. Open wp-content/plugins (or wp-content/themes) and find the folder with the same name as the one in the error. The error on the upload screen prints the full path.
  2. If the folder has a .php file with a Plugin Name: line, it is a real plugin. Go back to the first fix.
  3. If it holds only odd files, such as a readme.txt, a .git folder or one stray file, it is a leftover. Download a copy of anything you want to keep, then use the next fix.
FIX 03

Move the leftover folder out of plugins

  1. Move the folder to a place outside wp-content/plugins, for example into wp-content, or download it and delete it. With SSH: mv wp-content/plugins/ghost wp-content/ghost-old.
  2. Do not just rename it inside plugins. WordPress reads every folder there as a plugin. Rename an installed plugin's folder to ghost-old, install the zip again, and the Plugins list shows two "Ghost Plugin" entries.
  3. Upload the zip or click Install Now again. The install then says "Plugin installed successfully."
  4. Never delete the plugins or themes folder itself. Only the one folder named in the error.
FIX 04

With WP-CLI, add --force only when you mean to overwrite

  1. wp plugin install ./opening-hours.zip fails when the folder has files. wp plugin install ./opening-hours.zip --force removes the old folder and installs the zip. The WP-CLI docs say it overwrites "without prompting for confirmation".
  2. It also deletes anything you put in the old folder. A leftover old.txt is gone after --force.
  3. A plugin that was active before is still active after --force.
  4. Theme commands work the same way: wp theme install ./theme.zip --force.
FIX 05

Clear a leftover folder after Install Now

  1. If Install Now on a directory plugin shows "Installation failed: Destination folder already exists." and the plugin is not in your list, a leftover folder with that name is in the way.
  2. Move the folder named after the plugin's slug out of wp-content/plugins, then click Install Now again.
  3. Tested with Classic Editor: after the leftover folder was moved away, the button changed to Activate.

WordPress installs a plugin by moving its files into a folder named after it. If that folder already holds files, WordPress stops instead of mixing old and new files. Your site is not harmed. If you want the zip to replace what is there, use the Replace current with uploaded button, or --force in WP-CLI. If the folder is a stale leftover, move it away.

What you see#

It depends on where you started. The words are the same, the page around them is not.

Where you startedWhat it printsNext step offered
Plugins → Add Plugin, Install Now"Installation failed: Destination folder already exists."None. Dismiss the notice.
Upload Plugin, folder is a known plugin"Destination folder already exists." and the path, then a comparison tableReplace current with uploaded
Upload Plugin, folder is no known plugin"Destination folder already exists." and the pathGo to Plugin Installer only
wp plugin install without --force"Warning: Destination folder already exists." and "Error: No plugins installed."Add --force

Only the Install Now button adds the words "Installation failed:". That prefix comes from the Add Plugin screen's JavaScript (wp.updates.installPluginError() in wp-admin/js/updates.js), not from the upload page or WP-CLI.

The Classic Editor plugin card. The button says Installation failed. A red notice below says: Installation failed: Destination folder already exists.
Add Plugin, Install Now, with a folder called classic-editor that held one stray file. WordPress 7.1.4.

On the Upload Plugin screen, when the folder is a plugin WordPress knows, you get a choice instead of a dead end:

Installing plugin from uploaded file oh-1.0.0.zip. The line Destination folder already exists with a path. Then This plugin is already installed, a table with Current and Uploaded columns both showing version 1.0.0, and two buttons: Replace current with uploaded and Cancel and go back.
The upload screen when the folder is an installed plugin. The error line is still printed, but the page offers a way out.

When the folder is not a plugin WordPress recognises, there is no table and no button:

Installing plugin from uploaded file ghost.zip. Unpacking the package, Installing the plugin, then Destination folder already exists with a path, and a link Go to Plugin Installer.
The same upload with a leftover folder that holds only a text file. The only link goes back to the installer.

How the check works#

Every install runs through WP_Upgrader::install_package(). WordPress unzips the file into wp-content/upgrade. The top folder inside the zip gives the plugin's folder name. Then WordPress looks for that folder in wp-content/plugins.

Six stacked boxes. 1: unpack into wp-content/upgrade. 2: look at wp-content/plugins/NAME. 3A: missing or empty, files move in. 3B: has files and no overwrite asked, it stops. 3C: overwrite asked for, WordPress deletes the old folder and moves the new one in. Last: on the upload screen a known plugin gets a comparison and a Replace button.
The check happens after unpacking and before anything in plugins changes.

Two details in the code explain the results:

  • Only a folder with files counts. The code reads the folder's contents, and only stops when the list is not empty. With an empty plugins/ghost folder, wp plugin install goes through with "Plugin installed successfully."
  • Overwriting is a separate switch. The Replace button and --force set clear_destination. WordPress then deletes the old folder first and skips the check. This is why replace is safe for a clean upgrade and risky for a folder where you keep your own files.

On the upload screen, Plugin_Installer_Skin::do_overwrite() looks through the installed plugins for one whose file path starts with that folder name. This is a prefix match, not an exact one, so a leftover folder ghost also matches an installed ghost-pro/ghost.php, and you then get a table and a Replace button for the wrong plugin. If it finds none, there is nothing to compare, so you only get the error. That is why a leftover folder usually gives the dead end. Themes differ: a folder holding only a text file still got the comparison and the Replace installed with uploaded button, and clicking it gave "Theme updated successfully." So a stray theme folder is easier to clear than a stray plugin folder.

Try it yourself: terminal output#

A small test plugin, installed twice with WP-CLI on WordPress 7.1.4.

Terminal
wp plugin install /tmp/opening-hours.zipwp plugin install /tmp/opening-hours.zip
Output
Unpacking the package...Installing the plugin...Plugin installed successfully.Success: Installed 1 of 1 plugins.Unpacking the package...Installing the plugin...Warning: Destination folder already exists. "/var/www/html/wp-content/plugins/opening-hours/"Plugin installation failed.Warning: The '/tmp/opening-hours.zip' plugin could not be found.Error: No plugins installed.

The second warning, "could not be found", is a side effect. WP-CLI looks for the plugin after the failed install and cannot find the files it expected. The real error is the first warning. Directory installs print the same warning:

Terminal
wp plugin install classic-editor --force
Output
Unpacking the package...Installing the plugin...Removing the old version of the plugin...Plugin updated successfully.Success: Installed 1 of 1 plugins.

Why renaming inside plugins is a trap#

Several guides say to rename the folder instead of deleting it. That clears the error, but it leaves a second copy of the plugin in the same place, and WordPress treats each folder in plugins as its own plugin:

wp plugin list
name	title	statusakismet	Akismet Anti-spam: Spam Protection	inactiveghost	Ghost Plugin	inactiveghost-old	Ghost Plugin	inactive

Two copies with one name and two sets of functions can break the site if both are active. Move the old folder outside plugins, or delete it after you have copied out what you need.

A zip with no folder inside#

Some zips put the plugin file at the top, with no folder around it. On WordPress 7.1.4 these never hit this error. The upgrader names its unpacking folder after the zip plus 16 random characters (get_working_dir_name(), added in 7.1.4), and that name becomes the plugin folder. Installing the same flat zip twice gives two separate folders:

ls wp-content/plugins
flat-one-EIG1tpL1Q0g2vgKmflat-one-XP4Je9Zs2f80tbAE

So you get duplicates, not an error. Older WordPress versions were not tested; they name the folder after the zip file. If a zip from GitHub installs under an odd folder name, unpack it, put the files in one folder with the right name, and zip that folder.

If it keeps happening#

If the install still fails after you clear the folder, the message will be different. A folder that WordPress cannot write to is covered in could not create directory. A zip that holds no plugin file gives an "Incompatible Archive" message instead. If the old folder cannot be removed, see could not copy file and could not remove the old plugin. If the plugin installs but will not switch on, see plugin could not be activated. For a calmer routine on updates, read how to update plugins safely.

Sources

  1. WP_Upgrader::install_package() reference · clear_destination and abort_if_destination_exists
  2. wp plugin install, WP-CLI handbook · the --force option
  3. class-wp-upgrader.php in WordPress core · install_package() and the folder_exists check; get_working_dir_name()
  4. updates.js in WordPress core · wp.updates.installPluginError() adds the words Installation failed:
  5. class-plugin-installer-skin.php in WordPress core · do_overwrite() builds the comparison table and the Replace button
Newsletter

One email when something breaks or changes.

New plugins and re-tested guides, about twice a month. Never a sales pitch.