888888.888888.88""Yb..dP"Yb..8888b..Yb..dP.88b.88....db....8b....d8.88..dP""b8..dP"Y8
88__...88__...88__dP.dP...Yb..8I..Yb.YbdP..88Yb88...dPYb...88b..d88.88.dP...`".`Ybo."
88""...88""...88"Yb..Yb...dP..8I..dY..8P...88.Y88..dP__Yb..88YbdP88.88.Yb......o.`Y8b
88.....888888.88..Yb..YbodP..8888Y"..dP....88..Y8.dP""""Yb.88.YY.88.88..YboodP.8bodP'


88b.88.888888.888888.Yb........dP.dP"Yb..88""Yb.88..dP
88Yb88.88__.....88....Yb..db..dP.dP...Yb.88__dP.88odP.
88.Y88.88"".....88.....YbdPYbdP..Yb...dP.88"Yb..88"Yb.
88..Y8.888888...88......YP..YP....YbodP..88..Yb.88..Yb

January 9, 2008

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.

Uninstaller Example

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

Html 5 Gallery
Html 5 image gallery?
6 comments
page 1305
Fun With Sidebar Tabs Styling
Styling tabs css?
2 comments
page 336
Post Image The Easy Peasy Way
Theimage wordpress?
26 comments
page 1065
How To Add Sidebars To A Theme
Add widgetized footer in wordpress theme?
10 comments
page 1053
Html 5 Gallery
Html5 image gallery?
6 comments
page 1305
Wordpress Vs Graffiti
Graffiti yb combined?
8 comments
page 95
Poll Daddy Reviewed
Polldaddy poll?
2 comments
page 42
Why I Ditched Disqus
Add wordpress comments to friendfeed?
5 comments
page 1175
Html 5 Gallery
Html5 gallery?
6 comments
page 1305
Html 5 Gallery
Html5 gallery?
6 comments
page 1305
Post Image The Easy Peasy Way
Wp display all post images?
26 comments
page 1065
Quick N Dirty Post Exclusion
Fitler theloop addfilter?
11 comments
page 124
Using Your Own Url Shortener
Constructor and link shortner?
4 comments
page 1190
My Experience Of Flexx
Flexx of genesis wp theme?
4 comments
page 1026
Html 5 Gallery
Html5?
6 comments
page 1305
Wordpress Chat
Tchat page wordpress?
3 comments
page 1308
Quick N Dirty Post Exclusion
Filter wordpress posts plugin?
11 comments
page 124
Post Image The Easy Peasy Way
Wordpress attach images to post?
26 comments
page 1065
Post Image The Easy Peasy Way
Wp post orderby?
26 comments
page 1065
Auto Cycle Fun With Sidebar Tabs
Wordpress make your plugin updateable?
one comment
page 1129
Post Image The Easy Peasy Way
Wp add attachment?
26 comments
page 1065
Html 5 Gallery
Html 5 gallery?
6 comments
page 1305
Html 5 Gallery
Pictures html5?
6 comments
page 1305
Html 5 Gallery
Pictures html5?
6 comments
page 1305
Wordpress Chat
Postimagetheeasypeasyway?
3 comments
page 1308
Using Your Own Url Shortener
How to flushrewriterules?
4 comments
page 1190
Custom Hooks For Admin Pages
Addaction adminpost?
one comment
page 430
Custom Hooks For Admin Pages
Addaction adminpost?
one comment
page 430
Wordpress Chat
Chat themes?
3 comments
page 1308
Html 5 Gallery
Html5 wordpress?
6 comments
page 1305
Html 5 Gallery
Html5 photo gallery?
6 comments
page 1305
How To Add Sidebars To A Theme
Add more than one widget area to wordpress?
10 comments
page 1053
Post Image The Easy Peasy Way
Wordpress postimage img tag?
26 comments
page 1065
  1 query every 1273 seconds, updated 1 seconds ago.
Saturday, 10pm
 __
(__)
   `

 Kevin

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.

Saturday, 8am
 __
(__)
   `

 WordPress plugin unintaller | WP FUN

[...] 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 [...]

Monday, 5pm
 __
(__)
   `

 Lo hice y lo entend

[...] wp-fun » Fun with Uninstallation [...]

Friday, 9am
 __
(__)
   `

 WordPress Weekly – Episode 2 | Jeffro2pt0

[...] 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 [...]

Friday, 7pm
 __
(__)
   `

 Fun with Uninstallation, un plugin para desinstalar plugins | AplicacionesWeb

[...] 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 [...]

Thursday, 8am
 __
(__)
   `

 Personal Glory vs Community Spirit

[...] uninstall functionality that was recently discussed over several posts on this blog, and over at Weblog Tools Collection, was clearly something that should [...]

Saturday, 11pm
 __
(__)
   `

 WordPress Weekly – Episode 2 » Jeffro2pt0.com

[...] 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 [...]

Saturday, 5pm
 __
(__)
   `

 Craig

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

Saturday, 8am
 __
(__)
   `

 Binh Nguyen

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

Friday, 8pm
 __
(__)
   `

 Fun with Uninstallation 2

[...] 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 [...]

Friday, 5pm
 __
(__)
   `

 Andrew Rickmann

I think that is a great idea Keith, I would like to see the WPF as part of the core.

Friday, 12pm
 __
(__)
   `

 Keith

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!