There are two subdomains for my website. The subdomain for the production site is www.example.com
. The subdomain for the test site is test.example.com
.
test.example.com
is showing up in Google search results and needs to be removed. I have added a robot.txt
file and set up basic authentication for test.example.com to keep Google from crawling the site in the future.
Is it possible to remove URLS that contain test.example.com without removing www.example.com? Google search console states "All URL variations (www/non-www and http/https) will be affected"
. Does this mean if I remove https://test.example.com, https://test.example.com/page1.html, https://test.example.com/page2.html then https://www.example.com, https://www.example.com/page1.html, https://www.example.com/page2.html will also be removed?
UPDATE: I decided not to add basic authentication. I'm redirecting any test pages in the Google search to the production site. robot.txt
contains the following:
User-agent: * Disallow: /
It is my understanding that this can take weeks to remove the sight from Google search. Is there a way to make this happen sooner without affecting SEO on the production site?