When I'm checking the Google results for our site's site:example.com
, we get lots of index results like
xyz.example.com
xyz.example.com/abe
xyz.example.com/abcds
How do I disallow this type URL, so they don't show up in the search results?
Webmasters Stack Exchange is a question and answer site for webmasters. It only takes a minute to sign up.
Sign up to join this communityJust include the following in the robots.txt and upload the file in the root folder of your subdomain you want to block from Search Engines. Verify using robot tester in the Search console tool.
User-agent: *
Disallow: /
This is definitely the case when you should use meta tag "robots" and "noindex" the subdomain or what ever pages you want to hide from serps. After that, you could consider using url removal tool from google and getting rid of pages you don't want to see in serps, which will speed up the process a bit.
Do not go with robots.txt and blocking content of this type.
The correct answer to your question is to put a robots.txt file at the root folder of your subdomain or put robots meta tags on your subdomain's index page to block them from crawling and indexing.
It has very simple solution. You need to put the Robots.txt file in the root folder of your sudomain (i.e xyz.example.co
m).
After that you can use Robots meta tag to disallow SE from crawling your site (i.e xyz.example.com/abe
, xyz.example.com/abcds
).
robots.txt
. It doesn't disallow crawling, only indexing.
Jun 15, 2020 at 17:40
Try:
User-agent: *
Disallow: xyz.example.com
Or
Disallow: xyz.example.com/abc
Disallow: xyz.example.com/abcd
Disallow: xyz.example.com/abcde
When you have to execute your file, you allow it and you do not have to.
User-agent: *
Disallow: xyz.example.com
Disallow: /wp-admin/
Disallow: xyz.example.com
supposed to do? You can't have host names in a robots.txt file. If you are intending that to disallow a directory, that won't work either because directories start with a slash.
Jul 29, 2019 at 14:45