How To Put Your Website Under Maintenance Without Affecting Your Search Rankings Or Losing Money

The other day a student in my Create A Profitable Online Store Class” asked me a pretty good question.

Right now while I’m developing my site it doesn’t really matter but how do I put my store under maintenance after I’ve launched without affecting my search engine rankings?

The great thing about this question is that it applies not only to ecommerce shop owners but to all webmasters in general.

If you improperly put your website under maintenance, you could potentially destroy your search engine rankings while driving away customers at the same time.

Especially if you plan on bringing down your website for an extended period, it’s essential that you do things the right way.

Editor’s Note: If you are interested in learning how to start your own business, click here to take my FREE 6 day mini course on ecommerce.

Common Mistakes

But before I discuss the proper way to put a website under maintenance and what I do with my online store, I thought that I would talk about some common mistakes that I’ve seen people make with their sites.

Probably the worst and most egregious mistake that I’ve seen is to simply bring down your entire site and leave a bunch of pages stranded with “Page Not Found” errors.

Please do not do this! Unfortunately, you’d be surprised by how many times I’ve seen people edit their website this way.

Another common mistake I see is webmasters redirecting all pages on their site with a 301 redirect to a pre-made “under construction” page…and this is where the trouble starts.

On the surface, it might seem fine to bring down your site this away. After all if a human visits your site, they will see an attractive “maintenance” page and come back at a later date.

However in the eyes of the search engines, Google will think that your entire website has been moved and now points to your “maintenance” page. And given enough time, this could have disastrous results on your search engine rankings.

The problem is that it’s fairly easy to fall into this trap. For example Open Cart, a popular open source shopping cart that I recommend, offers a maintenance mode option which seamlessly redirects all customers to a custom “under construction” page.

However, the problem is that Open Cart uses “301 Redirects” which tells Google that the pages have been moved permanently. As a result, Open Cart’s maintenance mode is really only good for the beginning stages of web development when you don’t have any real customers yet.

A Better Solution

So what’s a better way to do this? A much better solution involves letting both humans and the search engines know that your website is only temporarily down and this can be accomplished with a special status message called a “503 status code”.

In a nutshell, a 503 code indicates that your website is temporarily unavailable. In addition to being unavailable, you can also tell the search engines when to come back again when you think your website will hopefully be ready.

Here’s how to issue a 503 status return code for your website. The first thing you need to do is create a special file called 503.php. Then in your 503.php file, you need to insert the following lines of code at the top of your file.

Note: The “Retry-After” parameter below indicates to the search engines when you want them to come back again. The time unit is in seconds so in the example below, we are telling Google to come back after 60 minutes.

<?php
header(“HTTP/1.1 503 Service Temporarily Unavailable”);
header(“Status: 503 Service Temporarily Unavailable”);
header(“Retry-After: 3600”);
?>

After these lines, you can then use the rest of this file to create a custom “under maintenance” page. Finally, you should edit your .htaccess file to redirect all visitors to your 503.php page by adding the following lines.


RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^111\.111\.111\.111
RewriteCond %{REQUEST_URI} !/503.php$ [NC]
RewriteRule .* /503.php [R=302,L]

In a nutshell, the above lines in your .htaccess file will redirect all visitors to your 503.php file which will tell both humans and search engines that your site is under maintenance.

Make sure that you put your own IP address where you see the numbers 111.111.111.111 above so that you can still access your site from your own computer.

The Best Way To Put Your Site Under Maintenance

So creating a 503 maintenance page is all fine and good but obviously the best solution to your maintenance problem is to never bring down your site at all which is what I do with my online store.

Instead of taking down my site whenever I need to work on it, I have 2 identical versions of my website installed on my server. The second copy of my site is called a staging site.

If I need to make changes to my online store, I can leave my existing website live while I work on an identical copy in the background. Then, once I’m done making and testing my new changes, I can immediately copy them over to the live site.

This way, I get a chance to thoroughly test and update my changes without worrying about losing sales.

There are two ways to create a staging site and it doesn’t matter which way you choose. One option is to create a completely separate subdomain for your site and create an identical installation.

For example, you could use the URL staging.yoursite.com for your staging site.

Alternatively, you can simply create a brand new subdirectory under your public_html directory and perform an identical installation there. Either way, you’ll end up with 2 versions of your live site to work with so you don’t miss out on any revenue.

So the next time you feel like you need to bring down your website for maintenance, you might want to consider implementing a staging site for your online store. After all, if your store is not open, then you aren’t making money.

Ready To Get Serious About Starting An Online Business?


If you are really considering starting your own online business, then you have to check out my free mini course on How To Create A Niche Online Store In 5 Easy Steps.

In this 6 day mini course, I reveal the steps that my wife and I took to earn 100 thousand dollars in the span of just a year. Best of all, it's free and you'll receive weekly ecommerce tips and strategies!

Note: This post above may contain affiliate links, which means that I may receive a commission if you make a purchase when clicking a link. Please consult our privacy policy for more information.

Related Posts In Ecommerce SEO

About Steve Chou

Steve Chou is a highly recognized influencer in the ecommerce space and has taught thousands of students how to effectively sell physical products online over at ProfitableOnlineStore.com

His blog, MyWifeQuitHerJob.com, has been featured in Forbes, Inc, The New York Times,  Entrepreneur and MSNBC.  

He's also a contributing author for BigCommerce, Klaviyo, ManyChat, Printful, Privy, CXL, Ecommerce Fuel, GlockApps, Privy, Social Media Examiner, Web Designer Depot, Sumo and other leading business publications.

In addition, he runs a popular ecommerce podcast, My Wife Quit Her Job, which is a top 25 marketing show on all of Apple Podcasts

To stay up to date with all of the latest ecommerce trends, Steve runs a 7 figure ecommerce store, BumblebeeLinens.com, with his wife and puts on an annual ecommerce conference called The Sellers Summit.  

Steve carries both a bachelors and a masters degree in electrical engineering from Stanford University. Despite majoring in electrical engineering, he spent a good portion of his graduate education studying entrepreneurship and the mechanics of running small businesses. 

22 thoughts on “How To Put Your Website Under Maintenance Without Affecting Your Search Rankings Or Losing Money”

  1. Chad says:

    This is why I read your site and subscribed to your emails…both the technical and nontechnical advice you give has helped enormously in setting up our own online business. Thanks again for your willingness to put your experience out there for everyone to learn from.
    One issue with the staging site idea though…I’ve seen where some people say having two similar databases on the same server could cause database corruption. Frankly I don’t know why that would happen but have you ever encountered anything like thator do anything to protect against it?

  2. Steve says:

    Nope, there should be reason why having 2 similar databases could cause corruption. The 2 DBs are completely independent.

  3. JB says:

    Is there a staging solution for people using sites like Shopify, or BigCommerce or would I need to pay for a separate account?

    1. Steve |MyWifeQuitHerJob says:

      Hey JB,

      Unfortunately, if you go with a fully hosted solution like BigCommerce, they won’t allow you to have 2 identical sites up at the same time without paying for it. When you go open source however, you have no such constraints.

  4. James McLaughlin says:

    Steve,

    Awesome insight, thanks for this. I had to learn the hard way about 503 maintenance pages. My hosting account had an old version of Joomla on it that wasn’t removed, it got hacked and even though my online store software wasn’t affected directly it was doing some redirection of pages from Joomla and Google flagged my site as ‘this site may be harmful to your computer.’

    Needless to say I freaked out but then got to work. I found out about the maintenance page through 503 error, brought that up. Totally removed the old worthless Joomla installation, validated all the code on my online store which was zen cart at the time (now on Magento) and then brought it back up. The hosting company was helpful on removing and validating the code but didn’t recommend or know about the 503 error handling that I used.

    After all was fixed I removed the 503 redirection and maintenance page and submitted my site back to Google web master tools the same day. To my delight they reviewed it and approved the update within 24 hours the message was gone in Google . Due to our swift action and communication with Google, it didn’t affect my search rankings as my traffic has steadily increased.

    Lesson learned – always update your open source software and plan design changes for upgrades, and if you have an old blog software on your hosting that you don’t use, take a backup just in case but totally remove it from your host.

    Other thing I need to mention here is for your staging.onlinestore.com site, make sure you restrict indexing on this using your robots.txt file. I had my staging site indexed in Google and I also freaked out. Then I got to work and used my robots.txt to restrict indexing of that site and the search results were gone within 2 weeks when Google re-indexed my site.

    Other lesson learned – don’t freak out, just get to work to solve the issue at hand 🙂

    As always Steve, top quality content and thank you for a top resource of building online stores that make you profits! I definitely share the love of Ecommerce Entrepreneurship with you!

    Highest Regards,
    James McLaughlin

    1. Steve |MyWifeQuitHerJob says:

      Thanks for the message! One of the problems with open source is that the code is wide open for hackers to dissect. I’m glad that you got everything resolved and no permanent damage was done

  5. Maroa says:

    Hi, always appreciating the notifications of new posts on the blog in my email inbox, thanxs!

    I would need more technical advice – as a newbie 🙂 – on how to copy my wordpress site (with woocommerce plugin for now): there is the database and the theme right? So I can copy the folder in ftp after creating a subdomain but then? I am sure some of you are more techie than me 🙂

    thanxs for sharing!

  6. Manny says:

    There is one issue with 2 copies of your site if you currently have a site that carrys any google rank. Duplicate Content. Google will punish your rankings if it sees duplicate content on the net so you have to make sure your copy site is NO INDEX NO FOLLOW

    1. Steve |MyWifeQuitHerJob says:

      My staging site is always password protected so no one can access it except me.

  7. Brad says:

    Never seen anyone give this advice before, so thanks for that!

    You’re right, doing a 301 redirect seems like the most natural and logical thing to do, and that is precisely why so many of us fall into that trap.

  8. Pingback: How To Put Your Website Under Maintenance Without Affecting Your Search Rankings Or Losing Money | Bizjama
  9. Jai Catalano says:

    This is very good information. I almost had a problem but I figured how to go about doing it right before maintenance.

  10. Spatch Merlin - How to Blog says:

    I never really thought about this issue not after reading this page. Every marketer should have a knowledge about this matter. I’ve seen websites which has been on maintenance for a while and made some compromises with their SE rankings. You clearly explained the idea in a way that even people without so much techie knowledge could understand.

    Spatch Merlin
    Your How to Blog Guide

  11. Lisa says:

    New brave world.

    I had been working in a safe web space that defaulted to ‘workspace’ until I was finished and wanted to publish it. It didn’t occur to me that you could risk changes to an active site [and need to take it down to work on it]. Just more to learn… on an amazing mountain of information. That’s okay, it’s what keeps the neuron’s sharp, right? ;D

  12. Mitch says:

    Great information and – I specifically like the fact that you mention the “common sense” solution of having a duplicate site under password protection, always ready.

    Mind you, there is some funny folk out there they want to earn money from selling their “modules” for that… ?? Hm ???

    Anyway, is it worth to mention still, the only thing one may not forget is, “Update Pat To DB” – which is obviously different and after moving pages/folders you may encounter some connection problems otherwise.

    Thanks for your tutorial.

  13. Anthony says:

    Hi

    Is there a way to find out if everything was done correctly ?
    Thank you

  14. Situs Belanja Online Terpercaya says:

    Thanks for a good information….

  15. Berita Unik says:

    good news information about that

  16. sulove says:

    It’s nice how can we do it in ASP?

  17. Steve says:

    What I don’t understand with the “staging” website idea is the database.

    What happens with them? So, I have
    – example.com and
    – stage.example.com

    They are identical, but all with 2 separate databases, and database users.

    I make massive changes to stage.example.com, adding new pictures, maybe even installing a new WordPress plugin etc. Then, how do I swap? I would think a simple overwrite is not enough, and I need to swap the database, too – no?! But that is a slightly longer process, maybe 10-20 minutes.

    So maybe I misunderstood something, can you please explain the swapping part in more detail?
    Thanks!

  18. Pingback: Curated Marketing News, SEO Spam, Top Blogs, Inbound Marketing
  19. ralali ilali says:

    i love this site

Comments are closed.