
There is a discussion going on over at Weblog Tools Collection about the difference between uninstalling, and deactivating, plugins. There are a lot of very good points made about the things that plugin authors can do to help maintain the WordPress user’s database.
To add to the discussion I have written a plugin that adds an uninstall option to the plugins page where there is a separate uninstall file included.
The file needs to have the same name as the plugin itself except but with the addition of _uninstaller on the end. So if the plugin is called my_plugin.php the uninstaller will be called my_plugin_uninstaller.php.

It will actually just include this file directly so it can’t echo anything to the browser. It can however register failure by redirecting back to the plugins page:
[php]
if ( $failure) {
wp_redirect('plugins.php?uninstalled=false');
}
There are a number of things in this plugin that are a tad kludgy and so it isn’t something I intend to release unless an unexpected demand occurs, but it is one idea to add to the mix. Perhaps seeing something in action will give someone else some other ideas.
You can download it here: Fun with uninstallation 0.1
It comes with an empty uninstall file for hello dolly.
Update: With 40 comments to date it is clear that there is a demand for this. I have opened a ticket in the WordPress trac to gain feedback from developers and hopefully move things forward with similar functionality being included.
When I was building this I wanted to make it use a hook in the same way as a normal plugin would and I struggled to find a way to do it, which is why I went with a separate file; however, the trac discussion may have yielded a better alternative. If that is the case, I will amend this plugin to use that methodology and hope that it gets included in the core in one of the later point releases.
You can join in with that here:
http://trac.wordpress.org/ticket/5625
Update 2: This has now been superseded by this post, fun with uninstallation 2 and fun with uninstallation 3
(__)
`
Great idea. I am suprised wordpress has not done this themself. Glad i found your site i will be checking out your other posts for more things i can use.
(__)
`
[...] process was documented in three posts: Fun with uninstallation part 1, part 2 and part 3. Note that the sample plugins that are linked to in these posts have been [...]
(__)
`
[...] wp-fun » Fun with Uninstallation [...]
(__)
`
[...] Rickmann – An Uninstall tool that adds an uninstallation option on the plugins page. The uninstall option will only show up if the plugin has been deactivated and if the plugin author [...]
(__)
`
[...] de Wordpress nos avisa de la existencia de un nuevo plugin para Wordpress, cuya finalidad es la de ayudarnos a desinstalar otros plugins. Algo que realmente parece ser demasiado molesto para la mayoría de [...]
(__)
`
[...] uninstall functionality that was recently discussed over several posts on this blog, and over at Weblog Tools Collection, was clearly something that should [...]
(__)
`
[...] Rickmann – An Uninstall tool that adds an uninstallation option on the plugins page. The uninstall option will only show up if the plugin has been deactivated and if the plugin author [...]
(__)
`
What a great idea – this has been an issue – now if we could just implement some standards among the plug-ins.
Keep to the good work!
< Craig
(__)
`
I’ve been desperate for a a core feature of wordpress to uninstall plugins.
It’s so annoying for the plugins to leave some junk in the database after they are deactivated / deleted.
Thank you very much for making this plugin and if possible please make it into the core.
Regards,
Binh Nguyen
(__)
`
[...] reading the comments on my first uninstallation plugin attempt, and the WordPress Trac, it become clear that the approach of using an external file probably [...]
(__)
`
I think that is a great idea Keith, I would like to see the WPF as part of the core.
(__)
`
Andrew – I definitely agree with you that the uninstall feature should be integrated into the core of Wordpress just as the activate / deactivate feature currently is. I also feel that this should be taken a step further and that a standardized plugin framework like the WPF should be integrated as well to help minimize the difficulty in developing, administering and configuring plugins.
I have placed a request in the Wordpress Trac system to have the WPF (or something like the WPF) integrated into the Wordpress core.
http://trac.wordpress.org/ticket/5429
It may be of benefit to you to create a request for a basic uninstall feature as well.
Keep up the good work!
(__)
`
Great thing! Yes, Wordpress would absolutely have to have a plugin uninstall function!
(__)
`
[...] he descobert un plugin que realitza aquest procés de desinstalació, però cal la implicació dels desenvolupadors dels [...]
(__)
`
[...] gasit insa un plug-in care iti dezinstaleaza plug-inurile. adik iti face curatenie si in baza de [...]
(__)
`
Fantastic idea. I was talking to Jeffro (who first pointed this out to me) not long ago.
It’s a great feature to have. Keep up the good work!
(__)
`
[...] be legendary post, Uninstall – Is There Such A Thing? Seems that there just might be such a plugin, Fun With Uninstallation Plugin by Andrew Rickmann. This plugin provides two times the joy for me as it is yet another plugin for [...]
(__)
`
Thanks Keith,
I think it is certainly an option, the only viable option at the moment, for developers to produce their own uninstall options and the WPF could be a massive help with that.
I think the best all round option is for the core to have an uninstall option as part of the plugins page that requires as little developer input as possible to operate.
(__)
`
[...] Fun with Uninstallation (tags: plugins wordpress) [...]
(__)
`
Great initiative! I hope that we will se more uninstallation-plugins for WP in the future. Be proud that u made the first step creating one wp-uninstall-plugin!
(__)
`
Andrew – The Wordpress Plugin Framework (WPF) that I developed allows for differentiating between deactivation and uninstallation of a plugin that has been developed using the WPF. I have provided a link to the latest version of the WPF below.
http://www.doubleblackdesign.com/2007/11/20/wordpress-plugin-framework-v004-released/
Basically, the WPF provides a “Deactivate Plugin” button to simply deactivate the specified plugin as well as an “Uninstall Plugin” button that removes the database entries associated with the plugin and deactivates the plugin.
(__)
`
A good idea, whose time has long been here.
(__)
`
Rob,
I did consider that option but I wanted it to be available when the plugin wasn’t enabled.
I think there are reasons why you might disable something and then after a period decide not to use it and it may be best not to have to activate it in order to uninstall it.
(__)
`
Great Idea!
(__)
`
hello
a note of appreciation. we did want this, I always had to go through the database, real awsome work..
(__)
`
A solution that I would prefer is to use the usual deactivation hook but have the plugin admin page have a check box or a separate button so that a flag is set which the deactivation routine can use to decide whether to leave stuff intact or wipe the slate clean.
(__)
`
Paul,
I have submitted this on the WordPress trac because I do think it is something that should be part of the core. One of the reasons why I am hesitant about releasing it is that there are other solutions that might be preferable.
The comments I have had are great but don’t really engage with the method of achieving the uninstall which means that although we now have an example of one method of achieving it we aren’t actually any closer to deciding that this is the way forward, i.e. that including a separate document. This is one issue that has already been raised on the trac, that it might be better to find a way of including the uninstall functions in the same plugin file.
(__)
`
This is definitely a step in the right direction, but what about the plugins that don’t have a separate uninstall file?
(__)
`
Great idea – I’ve been following the discussion over at WLTC too and was very pleased to see someone doing something.
I agree this should be a core feature. But someone has to take a first step and you’re the one, it seems.
I’m not a WP developer, but maybe you could submit this idea to the folks who work with the core of WP?
I’m sure something of the sort will eventually have to become part of WP.
But untill it’s part of the core, there’s nothing stopping you from making this plugin (once it’s finished) available to developers and users. And maybe developers could make their future plugins “uninstall compatible” or something like that.
(__)
`
best plugin ever!
(__)
`
Thumbs up! I agree that this should be a feature of WP itself. implementation of this could be beneficial for a plugin like “TinyMCE Advanced” which now asks if you want to delete the toolbar presets you mode when you temporarily deactivate this plugin. This could be shifted to the uninstall feature.
(__)
`
I too would vote for all the plugin authors forming a standard way to support plugin uninstallation and get as many wordpress plugins as possible compatible with Andrew’s tool.
(__)
`
Would just say thanks.
Always good to be able to keep the system clean.
Kjetil
(__)
`
Oh great! I was looking for a plugin like this for a long time!
Thanks!
(__)
`
BillH,
That’s a good idea and I will look at that.
(__)
`
I been looking for something like this now only if this was in the core file and not have to require plugin developer to write their code with this in mind.
(__)
`
After reading the blog post “Uninstall – is there such a thing” (http://weblogtoolscollection.com/archives/2008/01/07/uninstall-is-there-such-a-thing/), I’m pleased to see you’ve created a plugin that will properly uninstall (as opposed to just remove or deactivate), I hope that plugin developers now start to include an uninstall with their plugins so we can use your plugin effectively.
I’ll defnitely be using it
Thanks!
Dawn
(__)
`
great idea. something I could have used a hundred times.
(__)
`
while i fully applaud this tool, i kind of would prefer functionality like this rolled into the wordpress code itself. it would be extremely useful and nice to have wordpress move towards a mozilla-esque “extension” structure for plugins, wherein we can add, control, and remove plugins with as little stress as possible. this would help pretty much everyone- developers, site admins, and end users/visitors. so as a first step in a great direction, amen to this!
(__)
`
I think an uninstall plugin would go over well. I for one have a ‘messy’ WP database due to some leftovers from some plugins. I think if this functionality would remove things such as those, it would be a great thing.
(__)
`
I understand that the existing plugin hook is to be displayed after the plugin row. How about changing the line that currently says: “Uninstall all the options and settings (including database tables) relating to this plugin.” to read “Uninstall all the options and settings (including database tables) relating to xxxxxxx.”
(__)
`
[...] up the subject of uninstalling Plugins and within a few days, we have the start of an answer. Andrew Rickmann created a tool that creates an uninstallation option on the Plugins Panel which will appear if the Plugin has been [...]
(__)
`
Brilliant! Hope plugin developers take advantage of this on their own initiative. If it becomes popular, perhaps it will make its way into the WordPress core.
(__)
`
[...] engorro puede tener los días contados a poco que tenga aceptación entre los desarrolladores el plugin Fun with uninstallation creado por Andrew Rickmann y que permite precisamente eso, desinstalar el plugin en su totalidad. Para ello es preciso que [...]
(__)
`
I think there will be a big demand for this in light of the recent article at WTL. Currently I’m using Clean Option and the first time I ran it, it found over 300 orphaned items in the database! Not really sure if it actually approves database performance (much like using a registry cleaner on the Windows registry) but I’m fanatic about things like that. ;) I’ll give yours a shot as well. Can never have too many tools.
(__)
`
Nice tool!!!
I think it’s a great idea and I hope it catches on!
(__)
`
Great idea. I’d like very much to be able to uninstall directly from within WordPress.
(__)
`
Rob,
I completely agree.
(__)
`
Andrew,
It’s a great idea but it really needs to be in the core. As it stands the benefit as a plugin developer of writing to use it is minimal until there’s any guarantee that users will have it installed. There really needs to be a single solution to the problem of full uninstallation.
Thanks though for giving us something to chew on.
(__)
`
Thomas,
Unfortunately the plugin hook has been added after the row so I can’t include it in line. Otherwise I would have done.
Chip. It sounds like you may have got the wrong idea about what this does. This plugin is won’t do anything at all unless a plugin author decides to write their plugin with this in mind. It is intended to show some of the ideas discussed in the post I linked to. Apologies if I have misread your comment.
(__)
`
Great. I needed this plugin, as some of my other plugins left some traces in my database. I will clean it and then report back to say how it went. ;)
(__)
`
Great idea and absolutely useful. I like to see this as part of any plugin. One suggestion – I would place the uninstall part next to the deactivate space not as a full line beneath the box. This way it is more clear to which plugin it belongs.
(__)
`
[...] to Jeff’s post regarding uninstalling plugins, Andrew Rickmann has created a tool that adds an uninstallation option on the plugins page. The uninstall option will only show up if the plugin has been deactivated and if the plugin author [...]