designwithfocus

Technical SEO

Robots.txt vs Noindex: Crawl Rules and Index Rules

By Design With Focus Team 7 min read
A robots.txt file beside a noindex meta tag in a page head

Short answer

robots.txt vs noindex is a crawl rule versus an index rule. robots.txt asks crawlers not to fetch certain URLs. noindex asks Google to drop a URL after it has seen the tag or header. A disallow can hide that tag, so the URL may still appear. Use noindex on a page Google is allowed to crawl.

Last verified against the sources listed below.

Key takeaways

  • robots.txt manages crawl access. Google says it is not how you keep a web page out of Search.
  • noindex is a meta tag or an X-Robots-Tag header. Google drops the URL after it sees the rule.
  • The page must be crawlable. If robots.txt blocks it, Google never sees the noindex.
  • RFC 9309 says robots.txt rules are not access authorization. Other clients can ignore them.
  • Since WordPress 5.3, the discourage-indexing checkbox writes a noindex meta tag, not a disallow.

Robots.txt vs noindex decides two different questions. Google’s robots.txt guide says the file tells crawlers which URLs they can access, mainly so a site is not overloaded. It is not a way to keep a web page out of Google. For that, Google names noindex or a password.

Use the crawl file to manage fetching. Use noindex when the URL itself should leave the index. Mixing them so the crawler cannot see the tag is the mistake the noindex page warns about.

What does robots.txt control?

It controls a request to stay away from some URLs. RFC 9309, the Robots Exclusion Protocol, dated June 2022, defines groups in a file named robots.txt. A group starts with one or more user-agent lines and continues with rules.

A rule is allow or disallow. The memo says these rules are not access authorization.

Google uses that file to manage crawler traffic. For ordinary web pages, including HTML and PDF, the guide says you might disallow URLs so Googlebot fetches less, or skips unimportant and similar pages.

It then warns you not to use the file to hide those pages. If other sites link to the URL with descriptive text, Google can index the address without visiting. The result can show the URL and no description.

Media files are the exception Google draws. A robots.txt rule can keep image, video, and audio files out of Search results. It still does not stop a person from linking to the file. Resource files such as scripts and styles should stay available when the page is hard to understand without them.

If no group matches the crawler and there is no user-agent: * group, RFC 9309 says no rules apply. A missing or empty file is not a secret lock.

What does a noindex rule control?

It controls whether Google keeps the URL after a crawl. Google’s noindex documentation, last updated 10 December 2025, says noindex is a meta tag or an HTTP header. When Googlebot crawls the page and reads the rule, Google drops that page from Search results, even if other sites link to it.

The tag for every engine that honors it is meta name="robots" content="noindex" in the head. meta name="googlebot" content="noindex" limits the rule to Google’s web crawlers. You can combine hints, and Google’s example joins nofollow with noindex in one content attribute. Putting noindex in robots.txt is not supported.

Non-HTML files use a header instead. Google shows X-Robots-Tag: noindex on an HTTP 200 response, and says the same header can be none. That is how a PDF or an image file gets the rule without a head section.

The rule does nothing until a crawler sees it. Google says a page that is still in results may simply not have been recrawled, and that a revisit can take months. The URL Inspection tool is the recrawl request the page names. Technical SEO is the practice of making those crawl and index signals match what you meant.

When should you choose robots.txt?

Choose it when the problem is crawl load or a file type Google treats as media. The intro guide’s table is the decision. Web pages should not be hidden this way.

Image, video, and audio files can be kept out of Search results with a disallow. Unimportant scripts can be disallowed when the page still makes sense without them.

Question robots.txt noindex
What it answers May the crawler fetch this URL? Should this URL stay in the index?
Google, for a normal web page you want gone Do not use it as the hiding method Use it, and leave the URL crawlable
If other sites link to the URL The URL can still appear, often with no snippet After Google sees the rule, it drops the page
Where it lives A robots.txt file on the host A meta tag, or an X-Robots-Tag header
WordPress since 5.3 Not what the checkbox writes The checkbox writes noindex, nofollow
Does it block a visitor? No. RFC 9309 says it is not authorization No. The page is still on the server

Choose robots.txt for a crawl budget problem you can describe: a parameter that generates endless URLs, or a media file that should not be a Search result. Do not choose it because a page is embarrassing and you hope the file acts like a password. Google’s alternative for a real secret is to password-protect the file.

When should you choose noindex?

Choose it when Google may fetch the URL and must not keep it. Thin duplicates, thank-you pages, and internal search results are the usual shape. The page stays on the server for people with the link. It leaves Google’s results after Googlebot has seen the tag.

Choose the header when there is no HTML head. A PDF manual can send X-Robots-Tag: noindex and stay downloadable for a customer who has the address. Choose the meta tag when you can edit the head, or when the CMS will write it.

Choose a password when the content is private. Both Google and the WordPress reading screen say these signals do not block a visitor. How search engines work is the fetch-and-index pipeline these two signals sit on. A signal the crawler never receives cannot finish that pipeline.

Why can a disallow hide a noindex tag?

Because Google has to crawl the URL to read the tag. The noindex page says this directly. If robots.txt blocks the URL, or the crawler cannot access it, the crawler never sees noindex. The page can still appear, for example when other pages link to it.

That is the opposite of what people expect from stacking rules. Google’s robots.txt guide has a caution that combining crawl and index rules can make one rule cancel another. The fix it describes is to remove the robots.txt block, keep the noindex, and use URL Inspection to see the HTML Googlebot received. The Page Indexing report shows pages where Googlebot extracted a noindex rule.

A blocked page that still appears will often have no snippet, because Google indexed the URL from links and did not read the body. Removing the disallow lets the next crawl read the tag. It does not erase the URL the same day. Google says the wait depends on how important the page is, and that months are possible.

How does WordPress apply robots.txt vs noindex?

The Reading settings screen has a checkbox, “Discourage search engines from indexing this site.” WordPress.org’s documentation, last updated 8 June 2024, says the option dates from version 3.5.0. What it emits depends on the version.

Since version 5.3, checking the box generates meta name="robots" content="noindex, nofollow" into the head, if the theme uses wp_head. That is a real noindex. It matches the method Google documents, as long as some other robots.txt file does not disallow the same URLs.

Through version 5.2, the same checkbox could make a request for robots.txt return a disallow for the whole site. The doc says that older behavior works only if WordPress is installed in the site root and no robots.txt file already exists. A disallow of everything is the pattern Google says not to use when you want noindex to be seen.

The WordPress note at the bottom is the same limit RFC 9309 states. The option does not block access. Search engines have to honor it. Visitors can still open the site.

If the pages should stay in the index, leave the box unchecked and do not disallow them. Shrink the images instead of hiding them. web.dev says images often account for most downloaded bytes. The Image Compressor reduces a file in the browser before you upload it, which is a weight fix, not an index fix.

Frequently asked questions

Can you put noindex inside robots.txt?

Google says no. The noindex documentation states that specifying the noindex rule in a robots.txt file is not supported. Use a meta robots tag in the head, or an X-Robots-Tag HTTP header. The header is the option Google names for non-HTML files such as PDFs, video, and images. A disallow line is a different instruction. It talks about fetching, not about the index rule Google will honor after a crawl.

What happens if both a disallow and a noindex are present?

The disallow wins in the worst way. Google's noindex page says the crawler has to see the tag or header. If robots.txt blocks the URL, the crawler never sees noindex, and the URL can still show up in results when other pages link to it. Remove the disallow, leave the noindex in place, and let Googlebot fetch the page. Google notes that a revisit can take months, and it points to the URL Inspection tool when you want a recrawl.

Does robots.txt keep a private page private?

No. RFC 9309 says the rules are not a form of access authorization. Google says respectable crawlers may obey robots.txt, and other clients might not. A disallowed URL can still be indexed from links elsewhere, often without a snippet. Password-protect a file you actually need to hide. noindex is for a page you are willing to have fetched and unwilling to have kept in the index.

What does the WordPress discourage-search checkbox do now?

WordPress.org's Reading settings page says that since version 5.3 the checkbox generates a meta robots tag with noindex and nofollow, if the theme calls wp_head. Through version 5.2 it could answer robots.txt with a disallow for every URL, and only when WordPress was in the site root and no robots.txt file already existed. The page says neither behavior blocks visitors. Search engines still have to honor the request.

Should images on an indexed page be blocked?

Do not block resources Google needs in order to understand the page. The robots.txt guide says that if missing scripts or styles make the page harder to read, you should not disallow them. Images are a separate weight problem. web.dev says images often account for most of the bytes on a page. Compress the files you want crawled. Blocking them is not a speed technique, and it can strip context from the URL you hoped to rank.

Sources