What is robots.txt, and how does it affect Oh Dear's crawler?
A robots.txt file tells cooperating crawlers which paths they may request. It lives at the root of a website, such as https://example.com/robots.txt. Oh Dear's broken-links and mixed-content crawler respects it by default.
How robots.txt rules work #
Rules are grouped by user agent. An asterisk addresses crawlers generally; a named user agent addresses that crawler.
User-agent: * Disallow: /private/
This asks cooperating crawlers not to request paths beginning with /private/. An empty Disallow value does not exclude a path:
User-agent: * Disallow:
To configure Oh Dear specifically, follow how to add Oh Dear rules to robots.txt.
Why Oh Dear may report zero crawled pages #
A rule that disallows / can prevent the broken-links crawler from visiting the site. If a crawl reports zero pages, check the rules that apply to Oh Dear and the monitor's Respect robots instructions setting.
You can turn that setting off for the broken-links or mixed-content check when you intentionally want it to crawl paths that robots.txt excludes. Review the scope before changing it. The setting controls those crawls; it does not change what Google or other crawlers are allowed to request.
Crawling, indexing and access are different #
A robots.txt rule is not authentication. Anyone can read the file, and crawlers can ignore it. Protect private content with access controls.
Blocking a URL from crawling also does not guarantee that it disappears from Google Search. Google can discover the URL through links even if it cannot fetch the page. A noindex instruction must be available to Google's crawler to be read. See Google's explanation of robots.txt and indexing.
Do not use robots.txt as the only protection for a staging site, account page or internal dashboard.
Check the file after a change #
Open /robots.txt on the hostname being monitored and check that it contains the intended rules. Review broad rules such as Disallow: /, which are easy to leave behind after a migration. Then inspect the next crawl result in Oh Dear to check that the intended pages are being visited.