Using Google Custom Search for custom 404 pages?
-
I'm looking to create a better 404 page. I'm looking at integrating Google Search as a custom 404 page. I found this article: https://www.smashingmagazine.com/2014/08/a-better-404-page/
Basically, I want to grab whatever keyword(s) are in the broken page's URL and present custom Google search result to be displayed on the 404 page. Kind of like a "were you looking for this?" type of layout.
Does anyone have experience with implementing this? Someone on my organization said that Google may "penalize" such practices.
-
As long as those pages continue to return a 404 status code you shouldn't have any problem.
The "penalization" risk occurs when you allow those pages to be indexed with a 200 OK status code in the http header, and if you allow them to be crawled. Here are a few links to educate yourself on what the person was probably referring to:
https://www.mattcutts.com/blog/search-results-in-search-results/
Basically the strategy you outline is fine so long as those internal 404 and internal search pages aren't indexable by Google.
-
Thanks! This clears things up.