Common causes
- A previous installation failed halfway and left an incomplete folder
- The plugin was removed from the database list but its folder was not deleted
- The plugin's main file is missing or broken, so WordPress does not list it
- Uploading a ZIP whose folder name matches an existing plugin or theme
- File permissions stopped WordPress from deleting the old folder
How to fix it
- Check the Plugins or Themes list. If the plugin is listed, use the upload screen's "Replace current with uploaded" option or update it normally instead of installing again.
- Delete the leftover folder. If it is not listed, connect by FTP or the file manager and delete the folder shown in the error, for example wp-content/plugins/contact-form-7. Your plugin settings in the database are not removed.
- Or rename it as a backup. If you are unsure, rename the folder to contact-form-7-old instead of deleting it. Install again, test, then remove the old folder.
- Install again. Return to Plugins > Add New or Appearance > Themes and install the plugin or theme again.
- Use WP-CLI to force the install. Run wp plugin install contact-form-7 --force or wp theme install astra --force to overwrite the existing folder in one step.
Reinstall over an existing folder with WP-CLI
cd /home/user/public_html
wp plugin install contact-form-7 --force --activate
wp theme install astra --force How to stop it happening again
- Delete plugins from the Plugins screen, not by deactivating only
- Keep folder permissions at 755 so WordPress can manage them
- Do not interrupt installs or updates
- Use the Replace option when uploading a newer ZIP