We know that Google recommends using a 503 server status code for your your website goes offline or down temporarily for less than a day (hours not multiple days). But what if you know your site will be offline for days? John Mueller of Google said try to see if you can upload a static, HTML and temporary version of your site and/or most important web pages.
John said on Twitter "For longer outages, if search is critical for your site, I'd recommend setting up a temporary, static version of your important pages. This helps to keep pages indexed."
If you are planning this, it would be easy to save your web pages as HTML but if the site goes offline in an unplanned event then you need to likely find it on the Wayback Machine to grab a copy of the static HTML to upload to your server.
Here are John's tweets on how to do this:
This is not a step-by-step guide, there are too many options. In general, I'd do this:
— 🍌 John 🍌 (@JohnMu) March 11, 2021
1. Get a hoster where you can put some static HTML files and set the response code for your 404 pages.
2. Make your 404 page return 503.
3. Point your DNS there. You now have 503's everywhere.
8. Go to Search Console, performance report
— 🍌 John 🍌 (@JohnMu) March 11, 2021
9. Download the list of top pages shown
10. Repeat #5-7 for your most important pages (filenames may be a bit tricky to match)
Get the initial, hacky versions up quickly, improve them over time. This won't work for all site types (JS-sites, complex parameter URLs), but you may still be able to cover critical pages.
— 🍌 John 🍌 (@JohnMu) March 11, 2021
Obviously try to get the whole site back up normally as soon as you can :-)
Good luck! pic.twitter.com/vVOjeZ5yCV
and ... of course the devil's in the details, some of this will be hard, take time. But if your site's going to be down for 1-2 weeks, it's worth trying to tide things over in search, at least for the important pages.
— 🍌 John 🍌 (@JohnMu) March 11, 2021
And, if @internetarchive saves your butt, send them some $$$
Just one side note; Google won't penalize you for cloaking if you use a 503 for Googlebot in these extreme situations:
Technically cloaking, but if this is related to an outage, I don't see an issue with that. You just *must* make sure to resolve it as soon as possible - long-term 503 will remove the pages from the index, and it could be easy to forget about it if users see normal content.
— 🍌 John 🍌 (@JohnMu) March 11, 2021
Forum discussion at Twitter.