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

I want to show interface to admin on plugin deletion, having choices (radio buttons) with a question - "Please let us know why are you deleting the plugin?"

I know about register_uninstall_hook but I cannot use HTML code in it.

share|improve this question
up vote 3 down vote accepted

This isn't going to be possible, primarily because for anything in your code to execute it needs to be activated, but if you're deleting a plugin it has already been deactivated.

You can't ask on deactivation because there are a lot of cases were the plugin may be automatically deactivated, e.g. updates

Most of the scenarios where you would have those hooks such as register_uninstall_hook etc would not occur on an admin page but inside an iframe.

To be able to do this, you would need the following:

  • A second plugin to watch for the first plugins deactivation
  • Javascript to watch for the deletion/uninstall links being clicked

This will fail if:

  • The second plugin isn't installed ( people probably won't bother installing it if the only purpose is to provide you with feedback )
  • The first plugin is removed from the filesystem rather than the GUI
  • The second plugin is deactivated

Also consider what happens when the plugin is ran on a multisite and network activated/deactivated

My recommendation would be to not bother. Aside from the technical issues implementing it, it's bad user experience, and I can't see how it would do anything other than annoy your end users ( encouraging them to never install the plugin again )

share|improve this answer
Okay, thanks for the answer. – Rajat Varlani May 18 '14 at 9:38

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.