読み物SEO Basics · Technical SEO

Level: Basic

Crawling and Indexing Explained

robots.txt, XML sitemaps, meta robots, and canonical tags each do a different job. Learn which one controls crawling, which controls indexing, and why mixing them up hides pages.

Edeeson Opina8 min read

A Basic lesson card: lesson 2 of the SEO series, Crawling and Indexing Explained, with the Miso fox looking curious.

What you’ll learn

  • Read HTTP status codes the way a crawler does
  • Write a correct robots.txt and XML sitemap
  • Use noindex and X-Robots-Tag to keep pages out of the index
  • Explain why robots.txt can't remove a page from search
  • Check whether a page is indexable, step by step
On this page
  1. What crawlers do
  2. HTTP requests and responses
  3. robots.txt: rules for crawling
  4. XML sitemaps: a list of URLs you want found
  5. Meta robots and X-Robots-Tag: rules for indexing
  6. Blocking crawling is not the same as preventing indexing
  7. Indexability: the checklist
  8. Canonical URLs, briefly
  9. Common indexing issues
  10. Step by step: check whether a page can be indexed
  11. Common mistakes and troubleshooting
  12. Key takeaways
  13. Exercise
  14. References
  15. What's next

A page that search engines never fetch can't rank, and a page they fetch but don't keep can't rank either. Crawling and indexing are the two stages you control most directly, and most of the work comes down to a few small files and tags. This lesson explains what each one does, and especially what each one doesn't do, because mixing them up is one of the most common ways sites accidentally hide pages.

What crawlers do

A crawler is an automated client that requests URLs over HTTP, reads the responses, and queues new URLs it discovers. Google's main crawler is Googlebot, which today crawls primarily as a smartphone browser (mobile-first indexing). Other engines have their own crawlers, such as Bingbot.

Crawlers find URLs from:

  • links in pages they have already crawled (<a href="…"> elements),
  • XML sitemaps,
  • redirects from URLs they already knew,
  • and, for Google, URLs submitted with Search Console's URL Inspection tool.

They don't fill in forms, click buttons, or scroll the way a person does. If a page is reachable only after an interaction, assume a crawler won't find it.

HTTP requests and responses

Every crawl starts with a request and ends with a status code. The code tells the crawler what to do next:

  • 200 OK: the content is here; consider indexing it.
  • 301 Moved Permanently or 308 Permanent Redirect: the page moved; follow the Location header and treat the new URL as the one to keep.
  • 302 Found or 307 Temporary Redirect: follow it, but the original URL may stay the one shown in results.
  • 404 Not Found or 410 Gone: there is no page; drop it from the index over time.
  • 500-range errors: the server failed; try again later. If errors persist, the crawler slows down and eventually drops URLs.

You can see these yourself with curl, which prints the response headers:

Shell
curl -I https://www.example.com/guides/sourdough-starter/
HTTP
HTTP/2 200
content-type: text/html; charset=utf-8
cache-control: public, max-age=300

robots.txt: rules for crawling

robots.txt is a plain text file at the root of a host, such as https://www.example.com/robots.txt. It tells well-behaved crawlers which paths they may request. The format is standardized in RFC 9309 (opens in a new tab).

robots.txtText
# Applies to every crawler
User-agent: *
Disallow: /cart/
Disallow: /search
Allow: /search/help

# Where to find the sitemap (must be a full URL)
Sitemap: https://www.example.com/sitemap.xml

Key rules:

  • Each host and protocol has its own file. https://shop.example.com/robots.txt is separate from https://www.example.com/robots.txt.
  • Disallow: /search blocks every path that starts with /search, including /search-tips. Paths are prefix matches, and * and $ wildcards are supported by major crawlers.
  • When several rules match, the most specific (longest) one wins, so Allow: /search/help overrides Disallow: /search for that path.
  • robots.txt is public and voluntary. It is not a security tool: anyone can read it, and badly behaved bots can ignore it.

XML sitemaps: a list of URLs you want found

A sitemap is a file listing the canonical URLs you want search engines to know about. It helps discovery, especially for new pages or large sites, but it doesn't force indexing.

sitemap.xmlXML
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/</loc>
    <lastmod>2026-10-01</lastmod>
  </url>
  <url>
    <loc>https://www.example.com/guides/sourdough-starter/</loc>
    <lastmod>2026-10-20</lastmod>
  </url>
</urlset>

Per the sitemaps protocol (opens in a new tab), a single file can hold up to 50,000 URLs and 50 MB uncompressed; larger sites split into several files listed in a sitemap index. Google says it uses <lastmod> when it's consistently accurate and ignores <priority> and <changefreq>. List only URLs that return 200 and are the canonical version; a sitemap full of redirects and errors teaches crawlers to trust it less.

Meta robots and X-Robots-Tag: rules for indexing

To keep a page out of the index, use a noindex directive. In HTML it goes in the <head>:

HTML
<meta name="robots" content="noindex">

For files that aren't HTML (PDFs, images), or to set it server-wide, send it as an HTTP header:

HTTP
HTTP/1.1 200 OK
Content-Type: application/pdf
X-Robots-Tag: noindex

Other useful values include nofollow (don't follow links on this page), nosnippet (don't show a text snippet), and max-image-preview:large. You can target one crawler with its name, as in <meta name="googlebot" content="noindex">. The full list is in Google's robots meta tag documentation (opens in a new tab).

Blocking crawling is not the same as preventing indexing

This is the most important idea in the lesson:

  • robots.txt Disallow stops the crawler from fetching a URL.
  • noindex tells the search engine not to keep a URL it has fetched.

They work against each other if you combine them on the same URL. If robots.txt blocks a page, the crawler never fetches it, so it never sees the noindex. And a blocked URL can still be indexed without its content if other pages link to it: it may appear in results as a bare URL with no description.

So:

  • To keep a page out of search results, allow crawling and use noindex.
  • To save crawler effort on endless, low-value URLs (internal search results, filter combinations), use robots.txt, accepting that a few might still show as bare URLs if heavily linked.
  • To keep something private, use authentication. Neither robots.txt nor noindex protects content.

Google ended support for noindex inside robots.txt in 2019, so a line like Noindex: /private/ does nothing there.

Indexability: the checklist

A URL is indexable when all of these are true:

  1. It's allowed by robots.txt.
  2. It returns 200 OK (not a redirect, not an error).
  3. It has no noindex in a meta tag or header.
  4. Its canonical URL points to itself (or is absent).
  5. Its main content is present in the HTML, or rendered reliably by JavaScript.

Indexable doesn't mean indexed. Search engines still choose what to keep based on quality and duplication.

Canonical URLs, briefly

The same page is often reachable at several addresses: with and without www, with tracking parameters, or with and without a trailing slash. A canonical tag tells search engines which address you prefer:

HTML
<link rel="canonical" href="https://www.example.com/guides/sourdough-starter/">

It's a strong hint, not a command. Lesson 7 covers canonicalization in depth.

Common indexing issues

These labels come from Google Search Console's Page indexing report:

  • Crawled – currently not indexed: Google fetched it and chose not to index it yet. Often a quality or duplication signal.
  • Discovered – currently not indexed: Google knows the URL but hasn't crawled it yet, often on newer or larger sites.
  • Excluded by 'noindex' tag: as intended, or a template mistake.
  • Blocked by robots.txt: as intended, or an overly broad rule.
  • Alternate page with proper canonical tag: a duplicate that correctly points elsewhere. Usually fine.
  • Duplicate, Google chose different canonical than user: your canonical hint was overruled. Check redirects, links, and sitemaps for conflicting signals.
  • Soft 404: the page returns 200 but looks empty or like an error page.

Step by step: check whether a page can be indexed

  1. Request the URL with curl -I (or your browser's Network tab) and confirm 200 OK with no X-Robots-Tag: noindex.
  2. Open /robots.txt and check that no Disallow rule matches the path. Google Search Console's robots.txt report shows the version Google fetched.
  3. View the page source and search for name="robots" and rel="canonical".
  4. In Search Console, paste the URL into URL Inspection. It reports whether the URL is on Google, which canonical Google selected, and the last crawl. Test live URL checks the current version.
  5. If everything is correct but the page is new, select Request indexing and make sure at least one indexed page links to it.

Common mistakes and troubleshooting

  • Launching with the staging robots.txt. A leftover Disallow: / blocks the entire site. Check robots.txt in your launch checklist.
  • A noindex in a shared template. One line in a layout file can remove every page that uses it. Search the rendered HTML, not just the template you edited.
  • Blocking CSS and JavaScript. If the crawler can't fetch your scripts and styles, it may not render the page correctly.
  • Sitemaps that list non-canonical URLs. Every URL in a sitemap should be the final, 200, self-canonical address.
  • Expecting robots.txt to remove a page. To remove an indexed page, let it be crawled with noindex, or return 404/410. Search Console's Removals tool only hides a URL temporarily.

Key takeaways

  • Crawling is fetching; indexing is keeping. Use robots.txt to manage the first and noindex for the second.
  • A URL blocked in robots.txt can't show its noindex, and can still appear as a bare URL.
  • Sitemaps help discovery but don't guarantee indexing; list only canonical, 200 URLs.
  • Use authentication, not robots rules, for anything private.

Exercise

For your own site:

  • Open /robots.txt and explain each line in plain words.
  • Find your sitemap (from robots.txt or /sitemap.xml) and spot-check five URLs: do they return 200 without redirecting?
  • Pick a page that should never appear in search (a thank-you page, for example). Is it handled with noindex, or only with robots.txt?

Practice with RankMiso. On any page, RankMiso (our free extension) lists the indexability signals it finds under Technical: meta robots, Googlebot and Bingbot tags, canonicals, and the status code. In Chrome, Check this site goes further after you allow the site: it reads the X-Robots-Tag header, tests the path against robots.txt (the Googlebot group, else *), and says whether the URL is in the first listed sitemap. Confirm what Google kept with URL Inspection. Free on the Chrome Web Store (opens in a new tab) and Firefox Add-ons (opens in a new tab).

References

What's next

Your pages can now be found and kept. The next question is whether they match what people actually search for. Keywords, Search Intent, and Search Queries shows how to work out what a searcher wants before you write.

See every lesson in SEO: From Fundamentals to Advanced Optimization