WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi guys :) I know there is the wpmu_new_blog action hook which enables us to perform an action when a new WPMU blog is created. Is there something similar to this which enables us to perform an action when a WPMU blog is deleted? Something which looks like this:

add_action('blog_deletion_hook', 'function_to_perform')

share|improve this question
up vote 4 down vote accepted

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' );
share|improve this answer
This did the trick, thanks! Although I ran into the problem that the action I wanted to perform on deletion didn't work with WPMU. I solved this by 'Network Enabling' the plugin. :) – Steef Jan 25 '13 at 0:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.