How can I remove an option from ALL option tables in multisite?
-
Like any good plugin author, I’m wanting to remove the options my plugin creates when a user uninstalls it. I have the following code implemented in my uninstall.php file:
delete_option('my_plugin_option');
However, if my plugin was running on a multisite installation, and it was activated and/or used on multiple subsites, then the above method won’t work. The above method will remove the option from the
wp_options
table, but it won’t remove it from tableswp_2_options
,wp_3_options
, etc.I know I can just write a complete SQL script to go through all the tables and delete the options, but it seems like there needs to be a much more user-friendly way to help ensure all plugin authors are able to clean up after themselves.
Anyone know of such a way?
- The topic ‘How can I remove an option from ALL option tables in multisite?’ is closed to new replies.