SEOModule 5: Technical foundationsLesson 10 of 18
Course progress50%

22 min lesson · Updated August 2026

What are robots.txt, noindex, canonicals and redirects?

Robots.txt controls crawler access, noindex controls search inclusion, canonical links suggest a representative duplicate URL, and redirects send requests to another location.

What you will learn

By the end, you will understand:

  • Choose the correct technical control for a goal
  • Read common HTTP status codes
  • Avoid combinations that prevent search engines from seeing important directives

Visual explainer

See the idea clearly.

Four controls solve four different problems

Technical SEO becomes confusing when related tools are treated as interchangeable. Before adding a rule, state the intended outcome: Should a crawler request the URL? Should the page appear in results? Which duplicate should represent the content? Should people and crawlers be sent to a new address?

GoalPrimary ControlImportant Limit
Reduce or block crawling of a pathrobots.txtThe URL can still be known and may appear without a normal snippet.
Keep a crawlable page out of search resultsnoindexThe crawler must be able to access the page and read the directive.
Consolidate duplicate or very similar URLsrel="canonical" and consistent signalsIt is a strong hint; the search engine chooses the representative.
Move a URL to a replacementHTTP redirectUse the right destination and avoid chains or loops.

robots.txt manages crawler access

A robots.txt file sits at the root of a host, such as `https://example.com/robots.txt`. It gives rules to compliant crawlers. A rule can allow or disallow paths for a named user-agent. It is public and must never contain secrets.

Blocking a page in robots.txt is not a reliable way to remove it from search. If other pages link to the URL, a search engine may know the address without crawling its contents. It also cannot read a noindex instruction placed on a page it is forbidden to request.

Use robots.txt carefully for crawl management—such as certain internal search combinations or faceted URLs—after checking that important pages, CSS and JavaScript resources remain accessible.

noindex manages inclusion

A noindex directive can be placed in a page’s robots meta tag or an HTTP `X-Robots-Tag` header. It asks supporting search engines not to show that resource in search results.

The URL normally needs to remain crawlable long enough for the crawler to see the directive. If an indexed page is simultaneously blocked in robots.txt, removal can be delayed because the engine cannot revisit the page to confirm noindex.

Noindex is appropriate for pages that are public and usable but not suitable for search, such as some internal result pages or temporary campaign variants. Confidential information requires authentication, not noindex.

canonical links consolidate duplicates

A canonical link identifies the URL a site prefers for duplicate or near-duplicate content. It helps consolidate indexing signals and avoids presenting many versions of the same page as separate choices.

Support the preference consistently: link internally to the canonical URL, list it in the sitemap and redirect versions that do not need to remain available. Do not point unrelated pages to one commercial page merely to transfer imagined authority.

A self-referencing canonical—where a page names its own clean URL—can make the preferred version explicit. It does not rescue low-quality or unrelated content.

redirects move requests

A server-side redirect returns a response telling the browser or crawler to request another URL. A 301 or 308 generally means the move is permanent. A 302 or 307 generally means temporary. Search engines consider the broader signals and may treat long-lasting temporary redirects as permanent.

Redirect old pages to the most relevant replacement, not automatically to the home page. Update internal links so visitors do not travel through unnecessary hops. A redirect chain such as A → B → C adds delay and complexity; A should normally point directly to C.

HTTP status codes describe what happened

CodeMeaning
200The request succeeded and content was returned.
301 / 308The resource has moved permanently.
302 / 307The move is intended to be temporary.
404The requested resource was not found.
410The resource is gone.
500The server encountered an error.
503The service is temporarily unavailable; a Retry-After header can provide timing.

Common combinations that go wrong

A canonical page marked noindex sends conflicting goals: “use this representative” and “do not include it.” A page blocked in robots.txt cannot reliably communicate its page-level noindex or canonical. A redirecting URL’s page content and canonical may never be processed because the redirect sends the request elsewhere.

Test the actual HTTP response and rendered HTML. Do not trust a CMS checkbox label without verifying the output. Changes take time to be recrawled and processed.

  • Define crawl, index, duplicate or move as the actual problem.
  • Check the live status code and redirect destination.
  • Check robots.txt access.
  • Inspect robots meta and HTTP headers.
  • Confirm canonical signals agree across HTML, sitemap and internal links.
  • Use Search Console URL Inspection after deployment and recrawl.

Real-world example

Example: an event page after the event

Example

If the annual conference returns next year, the stable conference page can remain live and be updated, while year-specific archive pages remain accessible. If an old registration URL has been permanently replaced, redirect it directly to the current registration information. Redirecting every expired event to the home page would be less helpful and may be treated as a soft 404.

Try this

Diagnose before changing

Choose one URL that should not appear in search. Record its current status code, robots.txt access, robots meta, canonical and redirect behavior. Decide whether the real need is privacy, crawl management, deindexing, consolidation or migration.

Common questions

Questions beginners ask.

Can robots.txt keep a page private?

No. The file is public and only guides compliant crawlers. Use authentication and proper authorization for private content.

Should a noindexed page be blocked in robots.txt?

Usually not while removal is required, because the crawler needs access to read noindex.

Is canonical the same as 301?

No. A canonical suggests consolidation while both URLs may remain accessible. A 301 sends requests to the new URL.

Should every 404 redirect to the home page?

No. Keep a genuine 404 when no close replacement exists, and provide useful navigation. Redirect only when a relevant successor exists.

What is a soft 404?

A URL returns a success code or irrelevant redirect but appears to search systems to have no meaningful content, so it is treated like a missing page.

Can I remove a page from Google immediately?

Search Console removal tools can temporarily hide eligible URLs, but permanent removal requires the correct status or noindex and time for processing.

Where can noindex be set for a PDF?

A non-HTML resource can use an `X-Robots-Tag: noindex` HTTP response header.

Assessment

Check what you understood.

5 questions · instant explanations

1. Which control asks compliant crawlers not to request a path?
2. A public page should remain usable but not appear in search. Which primary control fits?
3. An old URL has permanently moved to a close replacement. What is normally appropriate?
4. What is wrong with putting noindex on a page and blocking it in robots.txt?
5. True or false: a canonical link forces Google to choose that URL.

Sources

Primary references.