A custom 404 error page can help you keep users on the website. In a perfect world, it should inform users that the page they are looking for doesn’t exist, and feature such elements as: HTML sitemap, navigation bar, and a search field.
But most importantly, a 404 error page should return 404 response code. This may sound obvious, but unfortunately it’s rarely so. See why it happens and what it can result in, according to Google Search Console:
“Just because a page displays a 404 File Not Found message doesn’t mean that it’s a 404 page. It’s like a giraffe wearing a name tag that says “dog.” Just because it says it’s a dog, doesn’t mean it’s actually a dog. Similarly, just because a page says 404, doesn’t mean it’s returning a 404…
Returning a code other than 404 or 410 for a non-existent page… can be problematic. Firstly, it tells search engines that there’s a real page at that URL. As a result, that URL may be crawled and its content indexed. Because of the time Googlebot spends on non-existent pages, your unique URLs may not be discovered as quickly or visited as frequently and your site’s crawl coverage may be impacted.
We recommend that you always return a 404 (Not found) or a 410 (Gone) response code in response to a request for a non-existing page.”