How to achieve SEO-friendly downtime with a 503 holding page

Whether upgrading your website, migrating servers or performing scheduled maintenance, it can be necessary from time to time to serve all of your visitors a temporary holding page. For those considering the potential SEO implications, it’s worth noting that with a little PHP – you can safely launch a holding page in the knowledge that you’re not going to harm your rankings.

By declaring the 503 HTTP status code on your holding page, you can inform Google (and the other search bots) that your website is ‘Temporarily Unavailable’, which they will typically honour. Rather then crawling and caching your website, they will simply come back later at a time and date of your choosing:

In the code above, you’ll see how you can set a 503 status on your holding page. Simply apply the PHP code on lines 1-4 to the very top of your holding page’s markup. On Line 3, you’ll see how the ‘Retry-After’ date can be specified to the bots. Be careful when setting this date however, it’s imperative that accurately check this before applying it to your holding page.

How to redirect all traffic to your holding page

Assuming that your holding page has been created on root file such as ‘offline.php’, it’s also very straight-forward to redirect all of your traffic to this page. Simply apply the following code to your .htaccess file: