Noindex, Robots.txt and Canonical: What Blocks Indexing

Noindex, Robots.txt and Canonical: What Blocks Indexing

You added a Disallow line to robots.txt, waited a month, and the page is still in Google. Or you're checking a new backlink and the page hosting it carries a tag you don't recognize. Both problems come back to one question: noindex vs robots.txt, and where the canonical tag fits in. Google, through its Search Central documentation, treats these three controls very differently. One is a rule, one controls access, and one is a suggestion. Mix them up and you often get the opposite of what you wanted.

Crawling, indexing and the three controls

Google handles a URL in two separate steps that people tend to blur together. Crawling is Googlebot fetching the URL. Indexing is Google deciding to store the page and make it eligible to appear in search. A page can be crawled and never indexed. Less obviously, a URL can be indexed without ever being crawled.

Each control acts on a different step:

  1. Robots.txt decides whether Googlebot may fetch the URL at all.
  2. Noindex tells Google not to keep a page it has already fetched.
  3. Canonical suggests which URL in a group of duplicates should represent the group.

Picture an office building. Robots.txt is the locked front door. Noindex is a sign inside a room saying "leave this room out of the directory." The canonical tag is a note saying "this room is a copy of 4B, list that one instead." If the front door is locked, nobody ever reads the sign or the note. That single idea explains most of the confusion below.

What does a noindex tag do?

A noindex rule tells search engines not to show a page in their results. Google has to crawl the page to see the rule. Once Googlebot reads it, Google removes the page from search results even if other sites link to it. You can set noindex in the page's HTML or in the HTTP response header.

The noindex meta tag

The noindex meta tag goes in the <head> of an HTML page:

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

The robots name applies to every search engine that supports the rule. To target only Google's crawlers, use <meta name="googlebot" content="noindex">. You can also combine rules, such as content="noindex, nofollow".

The X-Robots-Tag HTTP header

PDFs, images and videos have no <head>, so the meta tag can't reach them. The X-Robots-Tag header does the same job at the server level and works for non-HTML files:

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

On Apache, one rule in .htaccess covers every PDF on the site:

<Files ~ "\.pdf$">
Header set X-Robots-Tag "noindex, nofollow"
</Files>

A typical use is a post-signup thank-you page. Visitors need it, searchers don't, so noindex keeps it out of results without breaking anything. Just don't expect it to vanish overnight. Google's documentation notes that a recrawl can take months for less important pages, and the URL Inspection tool in Google Search Console lets you request one sooner.

Does robots.txt block indexing?

Not reliably. Robots.txt controls crawling, not indexing. Google says the file exists mainly to keep crawlers from overloading your site and is not a way to keep a page out of Google. A disallowed URL can still be indexed if other pages link to it. It just appears without a description.

Here's a standard file that blocks a checkout flow and internal search:

User-agent: *
Disallow: /checkout/
Disallow: /search

What robots.txt does and does not do

It stops compliant crawlers like Googlebot and Bingbot from fetching matching paths, which saves crawl activity on parameter URLs, faceted filters and heavy endpoints. It does not remove anything from the index, and it does not stop bots that choose to ignore it.

It also no longer supports noindex. Some sites used to put Noindex: lines in robots.txt, a rule Google never officially supported. Google announced in July 2019 that it would stop honoring those lines, and its current documentation states plainly that noindex in robots.txt is not supported.

A blocked page can't show Google its noindex tag

This is where robots.txt blocks indexing in the worst way: it blocks your other controls. If Googlebot can't fetch a page, it never sees the noindex tag, the X-Robots-Tag header or the canonical tag on it. Google can still index the bare URL from links pointing to it, sometimes with the link's anchor text attached.

Search Console reports this as "Indexed, though blocked by robots.txt." Search Engine Journal covered a WooCommerce store where Search Console flagged more than 51,000 URLs with that status, mostly add-to-cart parameter URLs. Google's help for the status says to remove the block and use noindex.

Canonical tags: a hint, not a command

A canonical tag points a duplicate or near-duplicate page at the version you prefer:

<link rel="canonical" href="https://example.com/shoes/red-sneakers/">

For a PDF, Google accepts the same signal as an HTTP header:

Link: <https://example.com/downloads/white-paper.pdf>; rel="canonical"

Google calls a canonical preference a hint, not a rule, and says it may choose a different page as canonical than you do. It weighs the tag alongside redirects, internal links, sitemaps and the content itself. So canonical tag indexing works differently from noindex. It doesn't decide whether content gets indexed. It decides which URL represents the content. If /red-sneakers/?utm_source=newsletter canonicalizes to the clean URL and Google agrees, the parameter version isn't indexed separately, and its signals (such as links) are consolidated onto the clean one.

One more rule from Google's canonicalization guidelines: don't use robots.txt for canonicalization. John Mueller explained why. With a disallowed page, Google can't even tell whether it matches anything else on the site.

Noindex vs robots.txt vs canonical: comparison table

Here's what each control actually blocks, with password protection and removal added for contrast:

ControlWhere it livesStops crawling?Stops indexing?How Google treats itWorks on PDFs and images?Best for
robots.txt Disallow/robots.txt at the site rootYes, for compliant botsNo, the URL can be indexed from linksCrawl ruleYes, by pathCrawl load, parameter and filter URLs
noindex meta tagHTML <head>NoYes, once crawledRuleNo, HTML onlyPages people need but search doesn't
X-Robots-Tag: noindexHTTP response headerNoYes, once crawledRuleYesPDFs, images, other files
rel=canonicalHTML <head> or Link headerNoOnly the duplicate URL, if Google agreesHintYes, via headerDuplicates and tracking-parameter variants
Password, 404 or 410ServerYesYesHard blockYesContent that must not be public

Read the table by column. Only the bottom row stops both crawling and indexing. Everything else does one job, and the job you need decides which control fits.

Common mistakes with noindex, robots.txt and canonical

Combining robots.txt and noindex

The classic error is adding noindex to a page and then disallowing it "to be safe." The disallow hides the noindex, so the URL can stay indexed. Google's Martin Splitt has advised using noindex without a robots.txt disallow when the goal is keeping a page out of results. The fix is to allow crawling, let Google see the noindex and drop the page, and only then decide whether a disallow is worth adding.

Pointing a canonical at another URL from a noindexed page

Mueller has called noindex and a cross-page canonical very contradictory signals. According to Search Engine Journal's coverage, Google will usually pick the canonical over the noindex when both are present. Choose one. Duplicates you're happy to consolidate get a canonical. Pages you never want shown get noindex.

Shipping staging settings to production

A staging site often runs with a sitewide noindex or the WordPress "Discourage search engines" setting. When the site goes live with that setting still on, indexing quietly stalls. Check the source of three or four live templates after every launch.

How to inspect these on a page you don't control

The URL Inspection tool only works for properties you own in Google Search Console, so for anyone else's page you check by hand. Three commands cover it:

# 1. Robots.txt rules for the whole site
curl -s https://example.com/robots.txt

# 2. Headers: X-Robots-Tag and canonical Link header
curl -sI https://example.com/guest-post/ | grep -iE "x-robots-tag|^link:"

# 3. Meta robots and canonical tags in the HTML
curl -s https://example.com/guest-post/ | grep -iE '<meta[^>]+robots|rel="canonical"'

When reading the robots.txt, find the group that applies to Googlebot (or *) and check whether any Disallow path matches the URL. Google treats those paths as case-sensitive. In the HTML, a canonical pointing at a different URL is worth noting, and a canonical pointing at a page that redirects or returns a 404 is a red flag. If the site builds pages with JavaScript, the raw HTML may differ from what Google renders, so compare it with the Elements panel in Chrome DevTools. For hundreds of URLs, a crawler like Screaming Frog reports indexability for each one in bulk.

When the block is on someone else's site

This is where the three controls hit link builders hardest. A backlink only helps if Google can crawl and index the page it sits on, which is the whole idea behind backlink indexing. Each control breaks that in a different way.

A noindexed linking page drops out of the index. Mueller once said links are between indexed URLs, so if one side is gone the link is ignored, though he later said it depends. Either way, you shouldn't count on it. A robots.txt block is worse: Google can't fetch the page, so it never reads your link at all. A canonical pointing elsewhere (common on syndicated articles and paginated comment pages) means Google may fold that URL into another one that doesn't contain your link.

So before you pay for a placement, or wonder why you have backlinks not getting indexed, run the three commands above on the linking page. No tool can override a site owner's noindex or Disallow. Those are instructions from the site itself, and Google follows them. A backlink indexer helps with what's actually fixable: a crawlable, indexable page that Google simply hasn't found or revisited yet. If the page is clean and still stuck, it may be sitting in the "crawled, currently not indexed" state, which is a quality decision rather than a technical block.

FAQ

Does robots.txt remove a page from Google?

No. Robots.txt stops crawling, but a blocked URL can stay in Google's index, usually without a description, if other pages link to it. To remove a page, allow crawling and add noindex, return a 404 or 410, or put it behind a password. For urgent cases, Google's Removals tool hides a URL temporarily while the permanent fix takes effect.

Does noindex pass link value?

At first, yes. Google can still crawl the page and follow its links. Over time, no. Mueller explained in 2017 that a long-term "noindex, follow" ends up working like "noindex, nofollow," because Google eventually stops crawling the page and drops it from the index. If you want a page's links to keep counting, don't leave it noindexed for months.

Can a canonical tag stop indexing?

Only for the duplicate URL, and only if Google agrees. A canonical tag asks Google to index a preferred URL instead of the current one, but it's a hint, so Google can ignore it. The content itself still gets indexed under the canonical URL. If you want a page out of search entirely, use noindex.

The short version of noindex vs robots.txt: robots.txt manages crawling, noindex manages indexing, and the canonical tag picks a representative. Use one control per job, and never let a robots.txt block hide the tag that does the real work.

Keep reading