How robots.txt and sitemaps work
robots.txt tells crawlers which paths they may fetch. A sitemap tells them which URLs you would like them to find. Both are plain files at well-known places, which makes them easy to break by accident: one stray slash can hide a whole section of your site from Google.
Which rule wins
Crawlers pick the group of rules written for their own name and fall back to the star group only if there is none. Inside that group the longest matching path wins, and when an Allow and a Disallow match equally well, Allow wins.
Wildcards and endings
A star matches any run of characters and a dollar sign at the end pins a rule to the end of the URL. That is how you block every PDF without touching a page with a similar name. Matching is case-sensitive for paths, but not for user agent names.
Blocked is not the same as removed
robots.txt controls crawling, not indexing. A blocked URL can still appear in search results if other sites link to it, just without a description. To keep a page out of the index, allow crawling and use a noindex tag instead.
Missing and broken files
A 404 means no restrictions. A server error is different: Google can pause crawling the whole site until the file answers again, so a failing robots.txt is worth fixing quickly.
Sitemap limits
One sitemap may hold 50,000 URLs and 50 MB uncompressed. Bigger sites use a sitemap index that lists several sitemap files. URLs should be on the same host as the sitemap and should return a 200 status.
Where to list your sitemap
Add a Sitemap line with the full address to robots.txt so every crawler finds it, and submit it in Google Search Console to see how many of its URLs were indexed.
Both files change whenever a developer, plugin or hosting move touches your site, often without anyone noticing. A check today does not cover next month. ViewCel can watch a page and tell you when something important about it changes.
