How to change bulk post status

Yes, it’s possible to loop all publish posts and change their post status to draft.

add_action('admin_init','wpse_244394');

function wpse_244394(){
    $args = array('post_type'=> 'post',
         'post_status' => 'publish',
         'posts_per_page'=>-1
    );
    $published_posts = get_posts($args);

    foreach($published_posts as $post_to_draft){
       $query = array(
        'ID' => $post_to_draft->ID,
        'post_status' => 'draft',
       );
       wp_update_post( $query, true );  
    }
}