XML sitemap and robots.txt mistakes that cost you pages

The most common sitemap and robots.txt mistakes are listing pages you block, blocking pages you want found, and leaving old URLs in the sitemap. Both files are plain text or simple XML, so they look harmless. But one wrong line can keep a whole section of your site out of search and out of AI answers.

What each file does

robots.txt sits at the root of your domain. It tells crawlers which paths they may or may not fetch. It controls crawling, not indexing. A blocked page can still appear in results if other sites link to it, just without a description.

An XML sitemap is a list of URLs you want search engines to know about. It can also include the last-changed date for each. It helps bots find pages, but it does not force them to index anything.

Think of robots.txt as the rules at the door and the sitemap as the map you hand over. They should agree.

robots.txt mistakes

  • A leftover Disallow: /. This is often copied from a staging site. It blocks the entire site.
  • Blocking CSS or JavaScript files. Bots need these to render a page the way people see it.
  • Blocking a folder that holds pages you want ranked. A broad rule such as Disallow: /blog hits more than you meant.
  • Using robots.txt to hide pages from search. To keep a page out of the index, use a noindex tag, and leave the page crawlable so the bot can read the tag.
  • Wrong file location. It must be at /robots.txt on the exact host. A file on a subdomain does not cover the main domain.
  • Syntax slips. A missing colon, a wrong path case or a stray character can change what a rule does. Paths are case sensitive.
  • Forgetting AI crawlers. If you want them to read your site, check the rules for their user agents. See robots.txt for AI crawlers.
  • No sitemap line. You can add Sitemap: https://example.com/sitemap.xml to robots.txt to point bots to your map.

XML sitemap mistakes

  • Listing non-200 URLs. Redirected, deleted or error pages do not belong in a sitemap.
  • Listing noindex or non-canonical URLs. The sitemap should hold only pages you want indexed, at their canonical address.
  • Listing URLs that robots.txt blocks. This sends mixed signals.
  • Out-of-date entries. New pages are missing and old pages remain. Generate the sitemap automatically.
  • Wrong or fake last-changed dates. If every page shows today’s date, search engines learn to ignore the field. Update it only when the content truly changes.
  • Exceeding size limits. A single sitemap file is limited to 50,000 URLs or 50 MB uncompressed. Use a sitemap index to split larger sites.
  • Wrong domain or protocol. URLs should use the same host and HTTPS version as the live site.
  • Never submitting it. Add it in Google Search Console and Bing Webmaster Tools so you can see errors.

A simple review routine

  1. Open /robots.txt and read every rule. Ask what each one blocks.
  2. Open the sitemap and pick ten URLs at random. Do they all return 200, have no noindex tag and use a self canonical?
  3. Test a few key URLs in the robots.txt tester or URL inspection tool.
  4. Compare the number of URLs in the sitemap with the number indexed in Search Console. A big gap is worth investigating.
  5. Re-check after each site release, a migration or a plugin change.

Keeping the two files honest

The files drift as a site grows. New sections appear, old ones are removed and someone adds a rule for a one-off reason. SuperRank is an autonomous AI SEO agent. Its technical SEO audit compares your sitemap and robots rules against the live pages, writes the fix and opens the pull request on its own. A person on your team reviews and merges it. For a quick check of a single page, use the page fix checker.

Quick FAQ

Do I need a sitemap for a small site? Not strictly, but it is cheap to add and gives you error reports.

Will blocking a page in robots.txt remove it from Google? Not reliably. Use noindex or remove the page.

Can I have more than one sitemap? Yes. Use a sitemap index file that lists them.