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:

  • Patrick Nel

    Hi James, thanks for the article. How long can one use the 503 until Google recognises it as your site is down?

    • Hey Patrick, to be honest I’m not 100% sure as I couldn’t see anything online from Google that would indicate how long they would honour it for. If you take a look at their Webmaster Central Blog post on this topic they do quote:

      It is important, however, to not treat 503 as a permanent solution: lasting 503s can eventually be seen as a sign that the server is now permanently unavailable and can result in us removing URLs from Google’s index.

      So no exact timings but I’d say you can get away with a week without worrying too much.

      • Patrick Nel

        Makes sense. Thanks so much for the reply!