Mobile app version of vmapp.org
Login or Join
Steve110

: Does specifying full webpage path in robots.txt would affect my website? It may be a silly question but I need to clarify my doubt because it's related to robots.txt. I need to prevent some

@Steve110

Posted in: #Googlebot #RobotsTxt

It may be a silly question but I need to clarify my doubt because it's related to robots.txt.

I need to prevent some label path of my website using robots.txt file.

User-agent: *
Disallow: /directory/wp-admin/path/label


If I give like this, would it affect all the paths separately?

Which means, does Googlebot consider directory, wp-admin, path and label separately?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Steve110

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

The path specified in the Disallow: field is simply a URL prefix. So, any URL that starts with this prefix will be blocked.

Disallow: /directory/wp-admin/path/label


From your example, this will therefore block all of the following URLs:

/directory/wp-admin/path/label
/directory/wp-admin/path/labelfoo
/directory/wp-admin/path/label/
/directory/wp-admin/path/label/bar.html


But will not block:

/directory/wp-admin/path/foo
/directory/wp-admin/path/
/directory/wp-admin/hello.html
:


Googlebot does not see the separate directories that make up the path. It is simply one value, one URL prefix.

More information on the Google Developers website: developers.google.com/webmasters/control-crawl-index/docs/robots_txt

10% popularity Vote Up Vote Down


 

@Jessie594

Robots.txt treats each path directive individually...

So, for example:-

User-agent:*
Disallow: /directory/wp-admin/path/label


This would disallow crawling of the directory label but not everything preceeding this directory nor following it.

User-agent:*
Disallow: /directory/wp-admin/path/label/*


This would disallow the crawling of everything within the directory label , including sub directories and their contents and the directory itself.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme