## multisite – How to delete user from MU site when the user is removed from their site?

Question

When an Administrator for a sub site removes a user from their sub site, I am trying to not only remove the user, but also completely delete them from the entire MU site. I have tried this:

add_action( 'remove_user_from_blog', 'custom_remove_user', 10,4 );
function custom_remove_user( $user_id ) { wpmu_delete_user($user_id );
}


but i am not able to get it to work – it is not actually deleting the user and it fact when creating the user it is not being assigned to the proper sub site.

If I input an actual number of an existing user, the function works properly.

Any other suggestions for how to handle this?

0
4 years 2017-01-05T10:59:42-05:00 0 Answers 0 views 0