public function remove_role( $args, $assoc_args ) {
		$user = $this->fetcher->get_check( $args[0] );

		if ( isset( $args[1] ) ) {
			$role = $args[1];

			self::validate_role( $role );

			$user->remove_role( $role );

			WP_CLI::success( "Removed '{$role}' role for {$user->user_login} ({$user->ID})." );
		} else {
			// Multisite
			if ( function_exists( 'remove_user_from_blog' ) ) {
				remove_user_from_blog( $user->ID, get_current_blog_id() );
			} else {
				$user->remove_all_caps();
			}

			WP_CLI::success( "Removed {$user->user_login} ({$user->ID}) from " . site_url() . '.' );
		}
	}
public function remove_role( $args, $assoc_args ) {
		$user = $this->fetcher->get_check( $args[0] );

		if ( isset( $args[1] ) ) {
			$role = $args[1];

			self::validate_role( $role );

			$user->remove_role( $role );

			WP_CLI::success( "Removed '{$role}' role for {$user->user_login} ({$user->ID})." );
		} else {
			// Multisite
			if ( function_exists( 'remove_user_from_blog' ) ) {
				remove_user_from_blog( $user->ID, get_current_blog_id() );
			} else {
				$user->remove_all_caps();
			}

			WP_CLI::success( "Removed {$user->user_login} ({$user->ID}) from " . site_url() . '.' );
		}
	}
public function remove_role ( $ args , $ assoc_args ) { $ user = $ this -> fetcher -> get_check ( $ args [ 0 ] ) ; if ( isset ( $ args [ 1 ] ) ) { $ role = $ args [ 1 ] ; self :: validate_role ( $ role ) ; $ user -> remove_role ( $ role ) ; WP_CLI :: success ( "Removed '{$role}' role for {$user->user_login} ({$user->ID})." ) ; } else { // Multisite if ( function_exists ( 'remove_user_from_blog' ) ) { remove_user_from_blog ( $ user -> ID , get_current_blog_id ( ) ) ; } else { $ user -> remove_all_caps ( ) ; } WP_CLI :: success ( "Removed {$user->user_login} ({$user->ID}) from " . site_url ( ) . '.' ) ; } }
Removes a user's role.

## OPTIONS

<user>
: User ID, user email, or user login.

[<role>]
: A specific role to remove.

## EXAMPLES

$ wp user remove-role 12 author
Success: Removed 'author' role for johndoe (12).

@subcommand remove-role
Removes a user s role .