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

My plugin allows for some custom templates to be installed into it by the user. Problem is, if someone deletes the plugin from WP in order to install a new version, all their custom files get deleted as well.

Is there a way to catch deletion and fire an alert warning the user of this, before they delete?

Oh and putting their templates into the DB is not an acceptable option.

share|improve this question

Consider using an external directory to store such dependencies for your scenario like WP_CONTENT_DIR.'/plugin-templates' (other then your real plugin folder) or smth. And allow users to remove it manually when they really want to uninstall.

I don't think you should delete plugins to update them... BUT I NEVER USED THE DEFAULT UPDATER (I disable it intentionally) so I don't even know how it works.


share|improve this answer
Yeah I don't recommend users delete in order to install, but I already know from some of my beta users that some people will do exactly that, so I'm trying to prepare for the inevitable. :) Thanks for the suggestion, I may have to go that route. – Jonathan van Clute Nov 2 '11 at 16:58

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.