You click "Install Now" on a plugin (or upload a theme ZIP), WordPress unpacks it, and then stops with "Destination folder already exists." Nothing gets installed and the plugin doesn't even show up in your list. It's a frustrating one, but it's also one of the easiest WordPress errors to fix once you know what's going on. Here's how to sort it out properly, and how to keep it from coming back.
What the error actually looks like
You'll usually see something like this on the install screen:
Installing Plugin: Contact Form 7 6.0.1
Unpacking the package…
Installing the plugin…
Destination folder already exists. /home/username/public_html/wp-content/plugins/contact-form-7/
Plugin installation failed.
The theme version says the same thing, just pointing at wp-content/themes/<theme-name>/. The path at the end is the important bit. It tells you exactly which folder is in the way.
Why it happens
WordPress refuses to install a plugin or theme into a folder that's already there. It's a safety check, so it doesn't silently overwrite files you might care about. The folder exists because of one of these:
- A failed or interrupted earlier install. Your browser timed out, PHP hit
max_execution_time, or the connection dropped halfway. WordPress created the folder but never finished, so the plugin isn't registered and doesn't appear in the dashboard. - The plugin was deleted from the database side only. Someone removed it via a database cleanup or a migration that skipped files, so the files are still sitting on disk.
- A broken or empty folder left behind after deletion. Deleting from the dashboard failed partway because of file permissions, leaving a half-empty folder.
- A migration or restore copied files in. You restored
wp-contentfrom a backup, and now you're trying to reinstall something that's already physically there. - You're uploading a ZIP of a plugin that's already installed. Common when you're trying to "update" a premium plugin by uploading the new ZIP.
Step 1: Check whether the plugin is actually installed
Go to Plugins → Installed Plugins (or Appearance → Themes) and search for it. Two possibilities:
| What you see | What it means | What to do |
|---|---|---|
| Plugin is listed | It's installed; you're trying to install it twice | Update it instead (see Step 4), don't reinstall |
| Plugin is not listed | Leftover or broken folder from a failed install | Remove the folder (Step 2), then reinstall |
If the plugin isn't listed, WordPress couldn't read a valid plugin header from that folder. That almost always means the folder's empty or incomplete.
Step 2: Remove the leftover folder
Before deleting anything, take a quick look inside. If you're reinstalling a plugin you used before, its settings usually live in the database, not in the plugin folder, so removing the folder won't wipe them. Still, a 10-second backup costs nothing.
Option A: cPanel File Manager
- Log in to cPanel and open File Manager.
- Go to
public_html/wp-content/plugins/(orthemes/). If WordPress lives in a subfolder or addon domain, use that document root instead. - Find the folder named in the error message, e.g.
contact-form-7. - Right-click it and choose Compress to make a quick ZIP backup.
- Then right-click the folder and choose Delete. Tick "Skip the trash and permanently delete the files" if you don't want it eating disk quota.
Option B: SSH / terminal
If you've got SSH access (on a VPS, or with SSH enabled in cPanel), it's quicker:
cd ~/public_html/wp-content/plugins
ls -la contact-form-7/ # see what's actually in there
tar -czf ~/contact-form-7-backup.tar.gz contact-form-7
rm -rf contact-form-7
Double-check the folder name before you hit Enter on that rm -rf. Tab-completion helps you avoid typos.
Option C: WP-CLI
WP-CLI can handle the whole thing in one command, overwriting what's there:
cd ~/public_html
wp plugin install contact-form-7 --force --activate
For themes it's wp theme install <slug> --force. The --force flag tells WP-CLI to replace the existing folder instead of failing.
Step 3: Reinstall from the dashboard
Once the folder's gone, go back to Plugins → Add New and install again. It should go through cleanly now. If it fails again with a different error, that's actually useful: it means the original install was failing for another reason, like permissions or a timeout, and the leftover folder was just a symptom. Jump to the "If it keeps coming back" section.
Step 4: Updating a plugin by uploading a ZIP
This is the case that trips up most people with premium plugins and themes. Since WordPress 5.5 you don't need to delete anything here:
- Go to Plugins → Add New → Upload Plugin and choose the new ZIP.
- Click Install Now.
- WordPress notices the plugin already exists and shows a comparison of the current vs uploaded version.
- Click Replace current with uploaded.
Themes work the same way under Appearance → Themes → Add New → Upload Theme. If you don't get the "Replace current" option and still see "Destination folder already exists," the folder name inside your ZIP probably doesn't match the installed folder (for example my-plugin-v2.4/ instead of my-plugin/), or the existing folder is broken so WordPress can't read its version. Fix the ZIP structure or remove the broken folder first.
If it keeps coming back
When the same error shows up every time you install something new, the leftover folders are a symptom. Something is killing installs halfway. Check these:
File ownership and permissions
On shared cPanel hosting, folders should be 755 and files 644, owned by your cPanel user. On a VPS, mismatched ownership is a classic cause, e.g. files owned by root after you ran something as root.
cd /var/www/example.com
sudo chown -R www-data:www-data wp-content # Nginx/Apache user on Debian/Ubuntu
find wp-content -type d -exec chmod 755 {} \;
find wp-content -type f -exec chmod 644 {} \;
Swap www-data for nginx or apache on AlmaLinux/Rocky, or for the PHP-FPM pool user if you run per-site pools.
PHP timeouts and memory
Big plugins (page builders, WooCommerce add-ons) can take a while to unpack. If max_execution_time is 30 seconds and the extraction takes longer, PHP dies mid-copy. In cPanel, open MultiPHP INI Editor and set something like:
max_execution_time = 300
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
Disk space or inode limits
If your account is out of disk quota or inodes, WordPress can create the folder but not write the files into it. Check the usage stats in cPanel's sidebar. A full disk is a very common hidden reason behind partial installs.
Security plugins or ModSecurity
Occasionally a security rule blocks the request partway through. If installs fail consistently and the server error log mentions ModSecurity, ask support to check which rule is firing rather than switching protection off yourself.
Prevention
- Don't refresh or close the tab while a plugin or theme is installing. Let it finish, even if it's slow.
- Update premium plugins with "Replace current with uploaded", not by deleting and re-uploading.
- Keep sensible PHP limits so large packages don't time out.
- Watch your disk and inode usage, especially on smaller hosting plans.
- Use WP-CLI on a VPS for bulk installs and updates. It's faster and gives clearer errors than the browser.
- Take a backup before big changes, so a half-finished install is never a scary situation.
Quick rule of thumb: if the plugin isn't in your list but the folder exists, the folder is junk from a failed install. Remove it and reinstall.
Frequently Asked Questions
Will deleting the plugin folder delete my plugin settings?
Usually not. Most plugins store settings in the WordPress database (the wp_options table or their own tables), not inside the plugin folder. Deleting the folder via File Manager or SSH doesn't run the plugin's uninstall routine, so your settings are normally still there when you reinstall.
I can't delete the folder in File Manager. What now?
That's normally an ownership problem: the files belong to a different user (like nobody or root) than your cPanel account. On shared hosting, open a support ticket and ask for ownership on that folder to be fixed. On a VPS, use sudo chown to correct it, then delete.
Is it safe to use WP-CLI's --force flag?
Yes, for public plugins and themes from WordPress.org. It just overwrites the existing files with a fresh copy. Just don't use it on a plugin you've customised by editing its files directly, because those edits will be overwritten.
Why don't I get the "Replace current with uploaded" option?
Either you're on a WordPress version older than 5.5, or the top-level folder inside your ZIP doesn't match the installed plugin's folder name, or the existing folder is broken so WordPress can't read it. Update WordPress, check the ZIP's folder name, or remove the broken folder first.
Does this error mean my site is hacked?
Almost never. It's a file-system safety check, not a security alert. That said, if you find plugin folders you never installed, investigate them, because unknown folders in wp-content/plugins can be a sign of malware.
