[CH] swiss made · hosted in switzerland · 0 data stored

Crawling and indexing: getting found by Google

Module 4 of 13 · 6 min read · by Phoenix · updated

What you will learn

  • Use robots.txt and XML sitemaps correctly
  • Master HTTP codes and redirects
  • Use canonical and noindex properly
  • Diagnose indexing in Search Console

Before a page can rank, Google has to discover it, crawl it and then index it. This module covers the tools that control these steps: the robots.txt file, the XML sitemap, HTTP status codes, redirects, the canonical tag, the noindex directive and JavaScript rendering. They are also the most common causes of “invisible” pages.

What is the robots.txt file for?

The robots.txt file, placed at the root of the site (https://example.ch/robots.txt), tells robots which parts of the site they may crawl. A typical example:

User-agent: *
Disallow: /admin/
Disallow: /cart/
Allow: /

Sitemap: https://example.ch/sitemap.xml

Three classic mistakes:

  • A forgotten Disallow: / after development, blocking the whole site. It is the first thing to check when a site disappears from Google.
  • Using robots.txt to de-index: a blocked page can still appear in the index if other sites link to it. To remove a page from the index you need noindex (see below), and the page must remain crawlable so Google can read that directive.
  • Blocking CSS and JavaScript files: Google needs them to render the page as a visitor sees it.

robots.txt is also used to manage AI crawlers (GPTBot, ClaudeBot, Google-Extended…). Module 12 explains which ones to allow.

How do you create an effective XML sitemap?

The sitemap lists the URLs you want indexed. It does not guarantee indexing, but it speeds up discovery, especially for new sites and poorly linked pages.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.ch/services/gel-nails</loc>
    <lastmod>2026-10-28</lastmod>
  </url>
</urlset>
  • Only include indexable pages: status 200, no noindex, canonical URL.
  • Fill in lastmod with the real date the content changed. Google uses it if it finds it reliable; a date that changes on every visit loses that trust.
  • Google ignores priority and changefreq: no need to fine-tune them.
  • Declare the sitemap in robots.txt and submit it in Search Console and Bing Webmaster Tools.
  • Above 50,000 URLs, split it into several sitemaps linked by an index. Most CMSs (WordPress, Shopify, Wix) handle all of this automatically.

Which HTTP codes should you know?

CodeMeaningSEO effect
200The page existsCan be indexed
301 / 308Permanent redirectPasses signals to the new URL
302 / 307Temporary redirectThe old URL often stays indexed
404 / 410Page not found / removedThe page drops out of the index over time
500 / 503Server error / maintenanceIf it persists, Google crawls less and may drop pages

For a redesign or a URL change, prepare a 301 redirect plan: each old URL to its closest new equivalent, never everything to the home page. Avoid chains (A → B → C) and loops. During maintenance, return a 503 rather than an empty page with a 200.

A “soft 404” is a page that says “not found” or shows almost nothing, while returning a 200 code. Google flags it in Search Console: fix the code or add content.

What is the canonical tag for?

The same content is often reachable through several URLs: with or without www, with sorting parameters (?sort=price), tracking parameters (?utm_source=…) or as a print version. The canonical tag states the reference URL:

<link rel="canonical" href="https://example.ch/services/gel-nails">
  • Every indexable page should carry a canonical pointing to itself (“self-referencing”).
  • The canonical is a hint, not a command: Google may choose another URL if signals conflict (internal links, sitemap, redirects).
  • Never point a canonical to a page that returns a 404, a redirect or a noindex.

When should you use noindex?

The noindex directive asks Google not to show a page in its results:

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

It suits pages that are useful to visitors but of no interest in Google: internal search results, thank-you pages, customer areas, test pages. After going live, check that no important page has kept a noindex: it is a common mistake when moving a staging site to production. For non-HTML files (PDF), use the HTTP header X-Robots-Tag: noindex.

Does Google read JavaScript websites?

Google does run JavaScript, but in a second pass and with limits. Moreover, most AI crawlers only read the raw HTML. In its 2026 guidance on AI features, Google even recommends checking that content remains visible with JavaScript turned off. Best practice:

  • The main text, headings and links must be present in the HTML sent by the server (server-side rendering or static generation).
  • Links must be real <a href> tags, not clicks handled only in JavaScript.
  • Test with Search Console’s “URL Inspection” tool, which shows the page as Google rendered it.

How do you diagnose indexing in Search Console?

  1. “Pages” report (Indexing): it lists indexed pages and the reasons for non-indexing. The most frequent: “Crawled – currently not indexed” (quality judged insufficient or duplicate), “Discovered – currently not indexed” (not yet crawled), “Page with redirect”, “Excluded by ‘noindex’ tag”.
  2. URL Inspection: for a specific page, it shows whether it is indexed and which canonical Google chose, and lets you request indexing after a fix.
  3. “Sitemaps” report: it confirms that the sitemap is read and how many URLs it contains.

A page marked “Crawled – currently not indexed” is not fixed by repeated indexing requests: you need to improve its content, differentiate it or merge it with another.

Key takeaway: robots.txt controls crawling, noindex controls indexing, canonical names the reference version and the sitemap helps discovery. Keep important content in the HTML and watch Search Console’s “Pages” report.

Module checklist

  • My robots.txt blocks neither the site nor CSS and JavaScript.
  • My sitemap contains only indexable, canonical pages returning 200, and is submitted in Search Console and Bing.
  • All my old URLs 301-redirect to their equivalent, without chains.
  • Every indexable page has a self-referencing canonical.
  • No important page carries a noindex.
  • My main content is visible in the HTML, even without JavaScript.

Frequently asked questions

How long does it take for a new page to be indexed?

From a few hours to several weeks. A page linked from well-crawled pages and listed in the sitemap is usually discovered quickly. Search Console’s URL Inspection lets you request crawling, with no guarantee of timing.

Should every page of a site be indexed?

No. A smaller index of useful pages is better than a large number of weak or duplicate ones. Search filters, thank-you pages or empty archives can stay out of the index.

What if my site disappeared from Google overnight?

Check in order: robots.txt (a forgotten Disallow: /), a site-wide noindex, server errors, then the “Manual actions” and “Security issues” sections of Search Console. Most sudden disappearances come from a technical error, not a penalty.