We have all been guilty of this. You have two websites, the first is the real live website that you have online, the second is a test site that is almost identical to your real site that is hidden away somewhere on the same server as the actual website, or another test server somewhere else.
The problem with this is that Google really does have a problem detecting which is the real website, and which is the test site. If you have paid to have a website made for you, chances are there is a test website located deep in some random programmers server. In extreme cases I have seen peoples test websites outranking their real website! I have also witnessed Google ranking the real and test websites 50/50.
To avoid conflicting websites competing with each other in Google I would recommend shutting down the test website altogether when you are no longer testing (Google won’t have a problem determining which site is the main site when one of them is no longer online), or creating a “noindex” tag on the test website which tells Google that you don’t want it indexed. I have found these two methods to render the best results.
You might be wondering why Google would rank a test website over the main website. The best answer I can come up with is that the test website has probably been around first, which means it was crawled by Google long before the real website went live. Google will generally credit the site it sees first over the duplicate site that appears later.
To find out if you have duplicate sites you can go to Google and copy and paste a few paragraphs of text located on your website. Google will then show the the websites that it associates with that text. If the test website shows up in results, you know you have a problem. Don’t hesitate in telling your webmaster to take the test site down.