Mobile app version of vmapp.org
Login or Join
Ann8826881

: In Google, to do a site: search on the main domain (eg. example.com), but exclude the subdomain test from the search results you would use the search: site:example.com -site:test.example.com

@Ann8826881

In Google, to do a site: search on the main domain (eg. example.com), but exclude the subdomain test from the search results you would use the search:

site:example.com -site:test.example.com


You would need to do this for each subdomain you wish to exclude from the results.


Is it possible to add a Code in domain.com robots.txt to not index the subdomains when search on google site:example.com?


However, you can't influence this behaviour in your server-side code, it is simply how Google's site: operator works. If your subdomains are indexed at all then they could be returned by a site:example.com search.

The only way to prevent your subdomain from appearing in the search results is to not have it indexed at all, which is not your intention.

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Ann8826881

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme