Function: remove_user_from_blog

remove_user_from_blog( integer $user_id, integer $blog_id, string $reassign )

Remove a user from a blog.

Use the \'remove_user_from_blog' action to fire an event when users are removed from a blog.

Accepts an optional $reassign parameter, if you want to reassign the user's blog posts to another user upon removal.


Name Type(s) Default Value Description
$user_id integer

ID of the user you're removing.

$blog_id integer ''

ID of the blog you're removing the user from.

$reassign string ''

Optional. A user to whom to reassign posts.


true | WP_Error

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.