O'Reilly logo

WordPress 3 Plugin Development Essentials by Everett Griffiths, Brian Bondari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Cleaning up when uninstalling

It could happen to any developer: a user decides to uninstall your plugin. It's a scenario that you should prepare for, especially if your plugin performs any database modifications. You should consider it a bit rude if your plugin makes custom modifications to the database or file system and does not clean up its mess when asked to leave. Cleaning up is just being considerate. Unfortunately, many plugin authors fail to do this, and who can blame them when the process is so poorly documented? Let's show you how to do this relatively simple task.

When you choose to delete a plugin, WordPress will look for a special file, named uninstall.php, located at the root of your plugin's directory. In it, you can place all the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required