• Henry Stock

    (@henrythe-stocksorg)


    I was reading the WordPress Plugin Handbook( https://developer.wordpress.org/plugins/the-basics/ ) and saw this piece of text:

    Two of the hooks you’ll need when creating a plugin are the register_activation_hook() and the register_uninstall_hook() hooks. The activation hook runs when you activate a plugin. You would use this to provide a function to set up your plugin — for example, creating some default settings in the wp_options table. The uninstall hook is used to clean up after your plugin. This runs after the deactivation hook, and deletes the plugin from the user’s WordPress installation.

    This got me to thinking. I have noticed with some plugins that the cleanup is not all that successful. For example, with a plugin named Mail Poet the deactivation and removal of the plugin left numerous tables still existing in the database. While the location of that particular quote from the handbook may not be the place to go into specifics, I would like to read a more detailed set of instructions for making sure that all remnants of a plugin are removed when it is deactivated and then deleted.

    Question: Is there a more detailed explanation of how to ensure that all traces of a plugin are removed?

  • The topic ‘Cleaning up on Plugin Removal’ is closed to new replies.