Context
I am building a web application with server side rendering on top of a headless CMS. Sometimes the CMS is down and the frontend has no idea what to display to the user, other than showing a generic error page. I am setting the HTTP status code to 500 and wondering what the proper metadata is to set in these cases.
Goals
- The page should not be removed from the index
- If possible, crawlers should not update their index of the page with the error page content
Possible actions
HTTP status codes
Sending 500 Internal Server Error
or 503 Service Unavailable
as appropriate seems like a good idea and hopefully causes the crawlers to not update the index and try again after some time.
noIndex
When Googlebot next crawls that page and sees the tag or header, Googlebot will drop that page entirely from Google Search results, regardless of whether other sites link to it.
Seems not to fit this case since the error is temporary, so I am not going to do this.
title
Seems like a good idea to set to something like Something went wrong | Sitename
for the users as it shows up in their tab etc. I just hope the crawlers don't update the index to it. If this value does end up in the index even if the HTTP status code was 500 or 503, I would put Path
| Sitename
or something similar.
Meta description
Depending on the above I would put either what I am going to show to the user, or something more specific that would fit better in the search result such as There was a temporary error during the last indexing of this page.