Deleted posts still appear on the sitemap and cause the crawler to give an error

I wonder if there is a special method to remove the posts that I have deleted from the blog, from the sitemap as well? Because they are still there and the crawler gives a 404 error

Don’t worry about the 404 since this is exactly the right response.

Ghost does remove references to deleted posts. If you’re still seeing it in the site map, check for caching.

A link to your site would be helpful.