Perform action on WPMU blog deletion

Yes, inside /wp-admin/includes/ms.php there is the action hook delete_blog.

This test prevents a blog deletion:

add_action( 'delete_blog', 'prevent_blog_delete_wpse_82961', 10, 2 );

/**
* @param int $blog_id Blog ID
* @param bool $drop True if blog's table should be dropped. Default is false.
*/
function prevent_blog_delete_wpse_82961( $blog_id, $drop ) 
{
    wp_die( 'aborting delete_blog' );
}

Leave a Comment