Use robots.txt to reduce crawling, and use meta robots to control indexing. Mixing them up is one of the fastest ways to waste crawl budget or leave unwanted URLs in search results. Google also states that robots.txt files larger than 500 KiB may be truncated, so even this small text file needs discipline [source: Google Search Central].
TLDR: Use robots.txt when you want to stop compliant crawlers from requesting whole sections, such as /cart/, /search/, or staging paths. Use meta robots when a page can be crawled but should not appear in search, such as a thank-you page or a thin internal result page. For example, a store with 12,000 filtered category URLs might block crawl paths in robots.txt and add noindex to 300 low-value pages that still need to load for users. In a cleanup like that, crawl hits on filter URLs can drop by 60% to 80% within several weeks, depending on bot behavior and site authority.
Robots.txt and meta robots solve different problems
Table of Contents
Robots.txt is a crawling instruction. It sits at the root of a site, usually at https://example.com/robots.txt. It tells search crawlers which paths they should not fetch. It is read before a bot requests pages from the site.
Meta robots is an indexing instruction. It sits in the HTML of a page, inside the <head> section. It tells search engines whether the page may appear in results, whether links may be followed, and whether snippets or cached copies may be shown.
The practical difference is simple:
- Robots.txt says: “Do not crawl this URL path.”
- Meta robots says: “You may crawl this page, but do not index it,” or “Do not follow links on it.”
The catch is that a crawler must access the page to see a meta robots tag. If robots.txt blocks the page, the crawler may never read the noindex directive inside it.
When to use robots.txt
Use robots.txt when the main goal is to reduce crawler access. This is useful for large sites, faceted search systems, internal tools, duplicate URL patterns, and low-value generated pages.
A basic robots.txt file may look like this:
User-agent: *
Disallow: /admin/
Disallow: /cart/
Disallow: /search/
Allow: /
Sitemap: https://example.com/sitemap.xml
This tells all compliant crawlers not to crawl admin, cart, and search paths. It also points them to the sitemap. That helps crawlers spend more time on useful URLs.
Robots.txt is a good fit for:
- Internal search pages with endless combinations.
- Shopping cart and checkout paths that have no search value.
- Admin areas that should not be requested by crawlers.
- Faceted navigation that creates thousands of near-duplicate URLs.
- Temporary crawl control during a site migration or cleanup.
Be careful, though. Robots.txt is not a security tool. Anyone can visit the file and see which folders are listed. If a page contains private data, use authentication, not robots.txt. It drives me crazy that teams still “hide” sensitive folders there, as if a public text file is a lock.
When to use meta robots
Use meta robots when a page should be accessible but should not appear in search results. This is common for pages that users need after taking an action, but that are not useful as search landing pages.
A standard noindex tag looks like this:
<meta name="robots" content="noindex, follow">
This means search engines may crawl the page and follow its links, but should not keep the page in the index.
Meta robots is a good fit for:
- Thank-you pages after a form submission.
- Login pages that are public but not useful in search.
- Low-value tag pages that still help users browse.
- Duplicate landing pages created for ads or tracking.
- Archive pages with thin or repeated content.
You can also use more specific values, such as:
noindex: do not show this page in search results.index: allow indexing.nofollow: do not follow links on the page.follow: allow link discovery from the page.nosnippet: do not show a text snippet or video preview.noarchive: do not show a cached version.
The common mistake: blocking a page and adding noindex
Many site owners block a URL in robots.txt and also add noindex to the page. That feels safe. It is often not.
If a crawler is blocked by robots.txt, it may not fetch the page. If it cannot fetch the page, it cannot read the meta robots tag. The URL may still appear in search results if other pages link to it. Search engines may know the URL exists, but lack enough information to process the exclusion directive.
So the rule is:
- If you want a URL removed from the index: allow crawling and use
noindex. - If you want to save crawl resources: block crawling with robots.txt.
- If the content is private: require login or block access at the server level.
Expect to waste time on this if your CMS adds tags automatically. Some SEO plugins add noindex while developers block the same pattern in robots.txt. The result is a messy signal that can take weeks to clean up.
What about X-Robots-Tag?
X-Robots-Tag is an HTTP header that sends robots directives without placing them in HTML. It is useful for PDFs, images, CSV files, and other non-HTML assets.
Example header:
X-Robots-Tag: noindex, noarchive
This is useful when a site has downloadable files that should remain accessible to users but stay out of search results. For example, an old pricing PDF may still be linked from customer emails, but should not rank in search after new prices are published.
How to choose the right method
Use this quick decision list:
- Do you need to stop bots from requesting the URL? Use robots.txt.
- Do you need the URL removed from search results? Use meta robots
noindexor X-Robots-Tag. - Is the page private? Use authentication or server restrictions.
- Is the URL duplicate but useful for users? Consider canonical tags, not just robots rules.
- Is the issue caused by crawl traps? Use robots.txt and fix internal linking.
For large ecommerce sites, the best answer is often a combination. Block endless filter paths such as ?color=red&size=xl&sort=price. Then use canonical tags on useful filtered pages that overlap with main category pages. For thin pages that must load for users, use noindex, follow.
Testing and maintenance
Never publish crawl rules and assume they work. Test them. A single slash can change everything.
Check these items before release:
- Robots.txt location: it must be available at the site root.
- Case sensitivity:
/Admin/and/admin/may be different paths. - Sitemap reference: include the correct sitemap URL.
- Noindex access: make sure crawlers can fetch pages that contain
noindex. - Production vs staging: do not copy staging blocks to the live site by accident.
Also review server logs. They show which bots request which paths and how often. Search Console can help confirm indexing changes, but logs often reveal crawl waste faster. If Googlebot requests 40,000 faceted URLs in one week and only 1,200 product pages, the crawl policy is not doing its job.
A serious control plan
Start with an inventory. List URLs that should rank, URLs that should exist but not rank, and URLs that should not be crawled at all. Then assign the right control to each group.
- Rank-worthy pages: allow crawl, allow index, include in sitemap.
- Accessible but not rank-worthy pages: allow crawl, add
noindex. - Crawl waste paths: block with robots.txt.
- Private content: require authentication.
Robots.txt and meta robots are not rivals. They are different controls for different risks. Use robots.txt to manage crawler access. Use meta robots to manage search visibility. Keep the rules clean, test them after every major release, and resist the urge to block everything that looks inconvenient.