WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When installing a plugin, it will not install if the directory to which it is attempting to install already exists. This means that users of our plugin must first manually deactivate and delete the plugin.

Is there any way to forcibly overwrite the directory or to deactivate the plugin and delete the directory at installation?

The only solution I can come up with is to deactivate and delete the previous version on activation, but not only would this require versioning the plugin directory, it would also apparently require versioning all of the plugin's functions.

share|improve this question
up vote 3 down vote accepted

If you're manually installing a plugin, you need to disable and delete the old version. However, WordPress does allow you to update your plugin programatically.

If your plugin is hosted on the WordPress.org repository, it will prompt the users to install updates for you. You've likely seen this with Akismet and other plugins already.

If your plugin isn't hosted on the WordPress.org repository, there are a few other things you can do. Many premium theme/plugin shops are including their own update scripts in their releases. It allows them to push out updates to their customers that use the standard WordPress update mechanisms to download the new package, install it, and remove old files.

Here are just a few examples:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.