Google 404 vs. 410 - Page is gone!

It's normal that web pages are removed some times but what's the best way to communicate this to search engines? Redirect? Not Found? There's a better way ...

Google 404 vs. 410 - Page is gone!

Recently I read this tweet what to do when a page was removed, SEO consultant demanded a 301 redirect, developer would find 404 more appropriate, after all, the page is not there ...

Permanent Redirect (301)

A 301 redirect is a permanent redirect to a different page, this makes sense if you are redirecting because you really moved the page. Let's say for example you contact form was under https://example.com/contact_us and you renamed the page contact. A 301 redirect from contact_us to contact makes perfect sense and returning a 404 not found here would be a very bad idea. After all the page was just moved and you want to tell this to search engines and also redirect users to the new page.

Not found (404)

Returning a 404 makes perfect sense if someone tries to access a page that does not exist on your webpage. Please do not redirect every non existing page with a 301 to the main page of your website. This is a bad user experience and also it would create duplicate content from a search engine point of view (yes yes you could avoid it with canonical).

If a user tries to access https://example.com/foobar but you have no foobar page, then of course it makes perfect sense to return a 404 and let the user + search engine know that this page does not exit.

Gone (410)

For the problem mentioned in the tweet where a page used to exist but is not there anymore, a 410 gone http status makes perfect sense. According to Google Webmaster the 410 tells google that the page is really gone and it's not coming back, as in a 404 code would tell google bot that the page might be coming back. You can look at the video from google regarding 404 vs. 401

See also Mozilla MDN docs on 410 Gone