Posts – display all posts except a post by an ID

Couple of issues here

  • IIRC, exclude should be an array of ID’s as exclude get passed to WP_Query as post_not_in

  • You are defining arguments which you don’t use. You could have simply passed that to get_posts. Rememeber, all parameters in WP_Query is available as is to get_posts as get_posts uses WP_Query

  • You can simply use 'offset' => 1, to skip the most recent post. You are running total unnecesarry queries here which slows your page down

You can try the following

$args = [
    'posts_per_page' => 5,
    'offset' => 1
];
$recent_posts = get_posts( $args );