I'm setting up a test website for one of my existing websites to experiment with different functions and designs. After the functions and designs are tested on the test website, they will be moved to the live website. The test website will be exactly the same as the live website as far as content. My question is: What is the best way to set up a test website without affecting the SERPs of the live website? Should I use a separate domain name? Should I noindex the bots in the robots.txt file? Should I remove the google analytics and ads? Any advice is appreciated.
You can put the site up on a separate IP address (or port) without any DNS. Then you access the site via IP/port address instead of a domain name. Or if your code contains references to your domain then you can modify your windows hosts file to map your production domain name to your test server's IP/port address. To keep the search engines away modify the robots file of the test site to make sure the search engine bots won't crawl the site. If you really want to be safe to make sure the search engines can't get to your test site you should modify your firewall so that only your (and your testers) IP addresses can get to the test site's IP/port address. This also keeps everyone else away from your test code before it's ready for production.