: 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
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.
More posts by @Ann8826881
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.