MainWP Community

Delete ManageWP Created Options for Cleanup when moving to MainWP

Remove ManageWP created options for cleanup when migrating from ManageWP to MainWP on child sites.

Snippet Type

Execute on Child Sites

Snippet

global $wpdb;

$plugin_options = $wpdb->get_results( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE 'mwp_%'" );

foreach( $plugin_options as $option ) {
    delete_option( $option->option_name );
}
2 Likes