Here is how to use HTTP 410 GONE status code to tell search engines those 404 urls they keep re-crawling over and over again have been permanently removed and will never be back.
If your website or blog is quite old, chances are you have removed posts, added and removed categories, tags, and media attachments over the years.
One of my older blogs has been up since 2007 and has had numerous code updates, themes, plugins, etc. And also went from http to https encryption, and was a nightmare of old dead urls that Google and Bing kept re-crawling over and over again.
While as a general rule 404 urls will not hurt your search rank, all this crawling over and over again looking for material that was removed long ago never to return sucks up server resources. It’s best to redirect those 404s to 410 Gone http status code. This signals bots the url they were requesting is permanently gone and to remove it from their re-crawl list.
For WordPress sites this plugin works great: 410 for WordPress.
This plugin will issue a HTTP 410 response to requests for articles that no longer exist on your blog. When you delete a post or page, it records the URL for that page and issues a 410 response when that URL is requested. You can also manually manage the list of obsolete URLs.
The HTTP Specification defines the 410 response header for use when a resource has been permanently removed. It informs robots visiting your site that the requested content has gone, and that they should stop trying to access it.