How do you take a site offline, without impacting his search performance? Good question. Google has recently published a blog post with his suggestion, that you should handle site maintenance correctly.
John Mueller, a Webmaster Trends Analyst at Google, wrote a blog post explaining how SEOs and webmasters can handle site outages or closures that last for a day or longer.
His recommendations are
Option 1: Block cart functionality
If you have an ecommerce site and you want to block users from buying anything. Google suggests, that you disable that particular function. In most cases, shopping cart pages can either be blocked from crawling through the robots.txt file, or blocked from indexing with a robots meta tag.
Since search engines either won’t see or index that content, you can communicate this to users in an appropriate way.
Option 2: show interstitial or pop-up
To block the entire site, your server should return a 503 HTTP result code (“Service Unavailable”). The 503 result code makes sure that Google doesn’t index the temporary content that’s shown to users. Without the 503 result code, the interstitial would be indexed as your website’s content.
Googlebot will retry pages that return 503 for up to about a week, before treating it as a permanent error that can result in those pages being dropped from the search results.
You can also include a “Retry after” header to indicate how long the site will be unavailable. Blocking a site for longer than a week can have negative effects on the site’s search results regardless of the method that you use.
Option 3: Switch whole website off
You can use option if you’re physically moving your server to a different data center. For this, have a temporary server available to serve a 503 HTTP result code for all URLs (with an appropriate informational page for users), and switch your DNS to point to that server during that time.
- Set your DNS TTL to a low time (such as 5 minutes) a few days in advance.
- Change the DNS to the temporary server’s IP address.
- Take your main server offline once all requests go to the temporary server.
- … your server is now offline …
- When ready, bring your main server online again.
- Switch DNS back to the main server’s IP address.
- Change the DNS TTL back to normal.