Robots.txt & XML Sitemaps: The Complete Guide

robots.txt and XML sitemaps are the two plain-text files that tell search engine crawlers where they're allowed to go and where your important pages actually are — robots.txt sets crawl permissions, and a sitemap is a direct list of URLs you want indexed. This guide covers the directives that actually work, the one most people get backwards (blocking a crawl is not the same as blocking an index), and the mistakes that quietly tank organic traffic for weeks before anyone notices.

🕒 Updated October 3, 2026 📘 ~10 min read 🆓 Free forever ⭐ Rate this guide
Rahib Ali
Written & maintained by Rahib Ali
Senior PHP/Laravel Developer & Technical SEO Specialist, 12+ years experience · Updated October 3, 2026

Written from real Search Console cleanup work — including the exact "Disallow: /" staging-to-production accident and the crawl-vs-index confusion described above, both seen repeatedly across real client audits.