ToolBrainy

Category: SEO

  • Meta Robots vs Robots.txt: What’s the Difference? (2026)

    Meta Robots vs Robots.txt: What’s the Difference? (2026)

    These two tools sound almost identical, get confused constantly, and control completely different things. Mix them up and you can accidentally keep a page out of Google — or leave a private page fully indexed. Here’s the plain-English difference between robots.txt and the meta robots tag, when to reach for each, and the one mistake that trips up almost everyone.

    The one-sentence difference

    Robots.txt controls crawling (whether a bot is allowed to fetch a page). The meta robots tag controls indexing (whether a page that’s been fetched is allowed to appear in search results). Crawling and indexing are two separate stages, and each tool governs a different one.

    What robots.txt does

    Robots.txt is a single file at the root of your domain that tells crawlers which paths they may or may not request. It’s a crawl instruction, issued before the bot ever loads the page:

    robots.txt

    User-agent: *
    Disallow: /wp-admin/
    Disallow: /cart/
    
    Sitemap: https://example.com/sitemap.xml

    Key point: Disallow stops a bot from crawling a URL — it does not guarantee the URL stays out of Google. If other sites link to a disallowed page, Google can still index the URL (usually with no description, because it was never allowed to read the content). If you need a hosted robots.txt fast, our Robots.txt Generator builds one in your browser, and the complete robots.txt guide covers every directive.

    What the meta robots tag does

    The meta robots tag lives in the <head> of an individual page and tells search engines what to do after they’ve crawled it. The most common use is keeping a page out of the index:

    In the page <head>

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

    This says: don’t show this page in search results, but do follow its links. Because it’s a per-page instruction that Google reads directly, noindex is the reliable way to keep a page out of search — unlike a robots.txt Disallow.

    Common values:

    • index, follow — the default; show the page and follow its links.
    • noindex, follow — hide the page, but still crawl its links (great for thank-you pages, filtered listings, thin archives).
    • noindex, nofollow — hide the page and ignore its links.
    • noindex can also be sent as an HTTP header (X-Robots-Tag) for non-HTML files like PDFs.

    The mistake almost everyone makes

    Here’s the trap: to reliably noindex a page, Google must be able to crawl it and read the meta robots tag. If you Disallow that same page in robots.txt, Google never fetches it, never sees the noindex, and the URL can linger in search results anyway.

    ❌ Conflicting signals

    # robots.txt
    Disallow: /private-page/
    
    # /private-page/ <head>
    <meta name="robots" content="noindex">
    # Google never crawls it, never sees noindex → may stay indexed

    Rule of thumb: if you want a page gone from Google, use noindex and make sure robots.txt allows crawling of it. Only use robots.txt Disallow to save crawl budget on sections you don’t care about indexing at all.

    When to use which

    Goal Use
    Keep a page out of Google reliably Meta robots noindex (allow crawling)
    Stop bots wasting crawl budget on admin/cart/search URLs robots.txt Disallow
    Hide a page but keep passing link equity noindex, follow
    Block a whole folder from crawling robots.txt Disallow: /folder/
    Keep a PDF or image out of search X-Robots-Tag: noindex header
    Point crawlers to your sitemap robots.txt Sitemap: line

    How they work together

    Used correctly, they’re a team: robots.txt keeps crawlers out of the areas that would waste their time (admin, cart, faceted URLs), while meta robots precisely controls which of your crawlable pages actually show up in search. Neither one forces Google to index a page — that’s always Google’s call — but together they give clear crawl and index signals.

    The bottom line

    Remember the split: robots.txt = crawling, meta robots = indexing. To remove a page from search, reach for noindex and leave it crawlable. To conserve crawl budget on junk URLs, reach for robots.txt Disallow. Never block a page in robots.txt and expect a noindex on it to work — that’s the contradiction that quietly leaves private pages in Google.

    Frequently asked questions

    Does robots.txt Disallow remove a page from Google?

    Not reliably. Disallow stops crawling, but if the URL is linked from elsewhere, Google can still index it (often without a description). To remove a page from search, use a meta robots noindex tag and keep the page crawlable.

    Can I use both robots.txt and meta robots on the same page?

    You can, but be careful: if robots.txt disallows the page, Google can’t crawl it and therefore can’t read its noindex tag. For a noindex to work, the page must be crawlable.

    What’s the difference between noindex and nofollow?

    noindex keeps the page out of search results. nofollow tells search engines not to follow the links on that page. They’re independent — noindex, follow is a common combination.

    Where does the meta robots tag go?

    In the <head> section of the individual page’s HTML: <meta name="robots" content="noindex, follow">. For non-HTML files like PDFs, use the X-Robots-Tag HTTP header instead.

    Which should I use to save crawl budget?

    robots.txt. Disallowing large, low-value sections (admin, internal search, faceted URLs) stops crawlers wasting requests there. Meta robots doesn’t save crawl budget because the page still has to be crawled to read the tag.

    Related tools & guides

  • The Complete XML Sitemap Guide (2026)

    The Complete XML Sitemap Guide (2026)

    If Google can’t find your pages, it can’t rank them. An XML sitemap is the single simplest way to hand a search engine a clean, complete list of everything on your site worth indexing. This guide walks through exactly what a sitemap is, when it actually moves the needle, how to build one for any platform, and how to submit it the right way in 2026.

    What is an XML sitemap?

    An XML sitemap is a machine-readable file — almost always at /sitemap.xml — that lists the URLs on your site you want search engines to crawl and index. Each entry can include a few optional hints: when the page was last modified, how often it changes, and its relative priority.

    Think of it as the index at the back of a book. Search engines can find your pages by following links, but a sitemap guarantees nothing important gets missed — especially deep pages, newly published content, or pages that aren’t linked from many places yet.

    What a real sitemap looks like

    A minimal, valid XML sitemap follows the sitemaps.org protocol and looks like this:

    sitemap.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
      <url>
        <loc>https://example.com/</loc>
        <lastmod>2026-07-01</lastmod>
      </url>
      <url>
        <loc>https://example.com/blog/</loc>
        <lastmod>2026-07-15</lastmod>
      </url>
    </urlset>

    Only two things are required: the <urlset> wrapper with the correct namespace, and one <loc> per URL. Everything else is optional. In practice, <lastmod> is the one extra field worth keeping accurate — Google uses it as a hint for re-crawling. It largely ignores <changefreq> and <priority>, so don’t lose sleep over them.

    Sitemap index files (for bigger sites)

    A single sitemap can hold up to 50,000 URLs or 50 MB uncompressed, whichever comes first. Larger sites split their URLs across several sitemaps and tie them together with a sitemap index file:

    sitemap-index.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
      <sitemap>
        <loc>https://example.com/post-sitemap.xml</loc>
      </sitemap>
      <sitemap>
        <loc>https://example.com/page-sitemap.xml</loc>
      </sitemap>
    </sitemapindex>

    This is exactly how WordPress, Yoast and most CMS platforms structure things by default: one index that points to separate sitemaps for posts, pages, categories and so on. You submit the index once and search engines discover the rest.

    Do you actually need a sitemap?

    Honest answer: a small, well-linked site (say, under 100 pages where everything is reachable from the menu) will get crawled fine without one. But a sitemap becomes genuinely valuable when:

    • Your site is large, or grows quickly.
    • You publish new content often and want it discovered fast.
    • Some pages aren’t well linked internally (orphan pages).
    • Your site is new and has few backlinks pointing in.
    • You have rich media (images, video) you want surfaced in the right places.

    There’s no downside to having one, so the practical rule is simple: always publish a sitemap. It costs nothing and only helps discovery.

    How to create an XML sitemap

    WordPress

    Since WordPress 5.5, core generates a sitemap automatically at /wp-sitemap.xml. If you use an SEO plugin (or the WPOS SEO engine), you’ll usually get a richer, cleaner sitemap at /sitemap.xml or /sitemap_index.xml. You rarely need to build one by hand.

    Shopify

    Shopify auto-generates /sitemap.xml for every store, split into products, collections, pages and blogs. It updates automatically — you just submit the URL.

    Static or custom sites

    For a hand-built site or a small custom app, the fastest route is a generator: paste your URLs (or your homepage to crawl) and download a ready-to-upload file. Our free XML Sitemap Generator does exactly this — no signup, and the file is built right in your browser.

    How to submit your sitemap to Google

    1. Open Google Search Console and select your property.
    2. In the left menu, go to Sitemaps.
    3. Enter your sitemap path (e.g. sitemap.xml) and click Submit.
    4. Wait for the status to read Success — Google will report how many URLs it discovered.

    You don’t need to resubmit every time you publish; search engines re-fetch known sitemaps on their own schedule. Submit once, then only revisit if you restructure the site.

    Link your sitemap from robots.txt

    Beyond Search Console, the other standard way to advertise your sitemap is a single line in your robots.txt file. Every major crawler reads it:

    robots.txt

    User-agent: *
    Allow: /
    
    Sitemap: https://example.com/sitemap.xml

    This is the belt-and-suspenders approach: the Sitemap: directive means bots that never touch Search Console (Bing, DuckDuckGo, and AI crawlers) still find your sitemap. If you don’t have a robots.txt yet, our Robots.txt Generator can create one with the sitemap line already included. For the full breakdown, see our complete robots.txt guide.

    Common sitemap mistakes

    • Listing non-canonical or redirected URLs. Only include the final, indexable version of each page. Never list URLs that 301/302 or 404.
    • Including noindexed pages. If a page is noindex, keep it out of the sitemap — mixing signals confuses crawlers.
    • Blocking the sitemap in robots.txt. Make sure you haven’t accidentally disallowed the path the sitemap lives on.
    • Stale lastmod dates. A lastmod that never changes is worse than none. Either keep it accurate or drop it.
    • Forgetting to update after a migration. After changing domains or URL structures, regenerate and resubmit.

    Sitemaps vs robots.txt: what does what

    These two files are often confused, but they do opposite jobs:

    • The sitemap says “here’s what I want you to crawl.” It’s an invitation.
    • robots.txt says “here’s what I don’t want you to crawl.” It’s a boundary.

    Used together, they give search engines a clear map plus clear no-go zones. Neither one forces indexing — that’s still Google’s call — but together they make its job far easier.

    The bottom line

    An XML sitemap won’t magically boost your rankings, but it removes the biggest risk for a growing site: pages that never get discovered. Publish one, keep it clean (indexable, canonical URLs only), reference it from robots.txt, and submit it once in Search Console. Then get back to the work that actually moves rankings — great content and links.

    Frequently asked questions

    Where should my sitemap be located?

    At the root of your domain, typically https://yoursite.com/sitemap.xml. It can technically live elsewhere if you submit it directly in Search Console, but the root is the convention every crawler expects.

    How often should I update my sitemap?

    If it’s generated automatically (WordPress, Shopify, most SEO plugins), it updates itself whenever you publish. For a hand-built file, regenerate it whenever you add or remove pages. You don’t need to resubmit each time — search engines re-crawl known sitemaps on their own.

    What’s the maximum size of a sitemap?

    50,000 URLs or 50 MB uncompressed per file, whichever comes first. Beyond that, split your URLs across multiple sitemaps and reference them from a single sitemap index file.

    Do I need both an XML sitemap and a robots.txt?

    Yes — they do different jobs. The sitemap lists pages you want crawled; robots.txt sets rules for what shouldn’t be crawled. Adding a Sitemap: line to robots.txt is the best-practice way to link the two.

    Will a sitemap improve my Google rankings?

    Not directly. A sitemap helps Google discover and crawl your pages faster and more completely, which is a prerequisite for ranking — but the ranking itself still depends on content quality, relevance and links.

    Should I include images and videos in my sitemap?

    You can, using the image and video sitemap extensions, if visual content is important to your traffic (e.g. a photography or recipe site). For most sites the standard URL sitemap is enough.

    Related tools & guides

  • Robots.txt for WordPress: The Complete 2026 Guide

    Robots.txt for WordPress: The Complete 2026 Guide

    If you run a WordPress site, there is a good chance you have never actually seen your robots.txt file — and yet it is quietly shaping how Google crawls every page you publish. WordPress generates one for you automatically, in memory, and most people never touch it. That is fine until the day you need to change it and discover there is no file to edit.

    This guide walks through exactly how robots.txt works on WordPress: where it lives, what the default rules do, a safe template you can copy, the handful of mistakes that quietly tank crawling, and how to check your work. No fluff, just the things that matter for a real WordPress site.

    What robots.txt actually does on WordPress

    A robots.txt file sits at the root of your domain (https://yoursite.com/robots.txt) and tells search engine crawlers which parts of your site they are welcome to request. It is the first file Googlebot looks for when it visits.

    Two things are worth burning into memory before you touch anything:

    • Robots.txt controls crawling, not indexing. Blocking a URL here stops bots from fetching it — but a blocked URL can still appear in search results if other pages link to it. To keep something out of the index, you need a noindex meta tag, not a Disallow rule.
    • It is a public file. Anyone can read yours. Never use it to “hide” login pages, private folders, or sensitive URLs — you are just handing out a map.

    The virtual file gotcha (this trips up everyone)

    Here is the part unique to WordPress. By default there is no physical robots.txt file on your server. WordPress creates a virtual one on the fly every time a bot requests it, using the do_robots hook. If you FTP into your site and look in the root folder, you will find nothing named robots.txt — but the URL still works.

    This matters because it changes how you edit it:

    • If no physical file exists, WordPress serves its virtual default (shown below).
    • The moment you upload a real robots.txt file to the site root, WordPress stops generating the virtual one and serves your file instead. Your file wins.
    • Most SEO plugins (Yoast, Rank Math, All in One SEO) let you edit the virtual file through the dashboard by filtering that same hook — so you get a real editor without touching FTP.

    What WordPress puts in the default robots.txt

    Out of the box, a WordPress site serves something close to this:

    Default WordPress robots.txt

    User-agent: *
    Disallow: /wp-admin/
    Allow: /wp-admin/admin-ajax.php
    
    Sitemap: https://yoursite.com/wp-sitemap.xml

    It is intentionally minimal, and honestly it is close to correct for most sites. It blocks the admin area, keeps admin-ajax.php open (many themes and plugins need it for front-end features), and points to the core sitemap. If your whole SEO setup is “leave it alone,” you could do a lot worse.

    A better robots.txt template for WordPress

    For a typical content or business site, this is a clean, safe starting point. Adjust the sitemap URL to match yours.

    Recommended WordPress robots.txt

    User-agent: *
    Disallow: /wp-admin/
    Allow: /wp-admin/admin-ajax.php
    Disallow: /?s=
    Disallow: /search/
    Disallow: /*?replytocom
    Disallow: /trackback/
    
    Sitemap: https://yoursite.com/wp-sitemap.xml

    What the extra lines do: /?s= and /search/ stop crawlers from wasting crawl budget on internal search result pages (which are thin and infinite). ?replytocom and /trackback/ block the low-value comment-reply and trackback URLs WordPress generates. None of this blocks a single real page or post.

    Rather than hand-editing, you can build a rule set for your exact setup — WordPress, WooCommerce, or a custom stack — with our free Robots.txt Generator. It writes valid syntax for you and adds the sitemap line automatically.

    What you should NOT block on WordPress

    This is where most robots.txt damage happens. A few Disallow lines that look tidy will actively hurt your rankings:

    • Never block /wp-content/. Your images, and often your CSS and JavaScript, live here. If Google cannot fetch your CSS/JS, it cannot render your pages properly and may judge them as broken or non-mobile-friendly.
    • Never block /wp-includes/ wholesale. Older “SEO hardening” guides told you to. Modern Google explicitly asks you not to — it needs those assets to render.
    • Do not block /wp-content/uploads/. That is your media library. Blocking it kills Google Images traffic.
    • Do not block your category or tag archives here if you want them indexed. If you want them out of the index, use a noindex tag (via your SEO plugin) instead — see the distinction below.

    Blocking specific bots

    You can set rules per crawler. A common example is allowing Google fully while slowing down or blocking a scraper:

    Per-bot rules

    User-agent: Googlebot
    Allow: /
    
    User-agent: AhrefsBot
    Crawl-delay: 10
    
    User-agent: SemrushBot
    Disallow: /

    A word of caution: well-behaved bots (Google, Bing) respect these rules; malicious scrapers ignore robots.txt entirely. Use it for crawl management, not security. And in 2026, many site owners also add explicit rules for AI crawlers like GPTBot and PerplexityBot — allow or disallow them based on whether you want your content used for AI training and answers.

    WooCommerce and plugin considerations

    If you run a store, WordPress and WooCommerce generate URLs you almost certainly do not want crawled:

    WooCommerce additions

    Disallow: /cart/
    Disallow: /checkout/
    Disallow: /my-account/
    Disallow: /*add-to-cart=*

    The cart, checkout, and account pages are user-specific and have no search value, and the add-to-cart query strings create endless duplicate URLs. Blocking them keeps crawlers focused on your product and category pages, where the traffic actually is.

    Common WordPress robots.txt mistakes

    • Leaving a Disallow: / from a staging site. Developers block everything during a build. If that line survives launch, you have told Google to crawl nothing. This is the single most common way a new WordPress site gets zero traffic.
    • Using robots.txt to deindex. Blocking a page here does not remove it from Google — it just stops Google from seeing the noindex tag on it. To remove a page, allow crawling and add noindex.
    • Blocking CSS/JS. Covered above, but it is worth repeating: it breaks rendering.
    • Forgetting the sitemap line. It is a free, direct signal to crawlers. Always include it.
    • Editing the wrong file. If your SEO plugin manages a virtual robots.txt but you also uploaded a physical one, the physical file wins and your plugin edits do nothing.

    Robots.txt vs noindex: which to use

    This is the distinction that fixes 90% of confusion. They solve different problems:

    When to use which

    Goal: Save crawl budget on junk URLs  → robots.txt Disallow
    Goal: Keep a page out of Google       → noindex meta tag
    Goal: Both                            → allow crawl + noindex
                                            (NOT Disallow — the bot must
                                             be able to see the noindex)

    Rule of thumb: if you never want a bot to fetch it, use robots.txt. If you are fine with fetching but want it kept out of search results, use noindex. If you want a page gone from Google, do not block it in robots.txt, because then Google can’t read the noindex tag telling it to leave.

    How to test your robots.txt

    After any change, verify it:

    • Load it directly: visit https://yoursite.com/robots.txt in a browser. What you see is what bots see.
    • Google Search Console: the robots.txt report shows the fetched version, when it was last crawled, and any parse errors.
    • Spot-check a URL: use the URL Inspection tool in Search Console to confirm an important page is not accidentally blocked.
    • Confirm your sitemap resolves: the URL in your Sitemap: line should return a valid XML sitemap, not a 404.

    Two of our tools pair naturally with this: build the file with the Robots.txt Generator, then generate the matching sitemap with the XML Sitemap Generator so the two line up.

    Frequently asked questions

    Does WordPress have a robots.txt file by default?

    Yes, but it is virtual — generated in memory, not saved as a file on your server. Visiting yoursite.com/robots.txt shows it. As soon as you upload a real file to the site root, WordPress serves that instead.

    How do I edit robots.txt in WordPress without FTP?

    Use an SEO plugin. Yoast, Rank Math, and All in One SEO all include a robots.txt editor in the dashboard that modifies the virtual file for you — no FTP or file manager needed.

    Should I block wp-admin in robots.txt?

    WordPress already does, and that is fine — but always keep the Allow: /wp-admin/admin-ajax.php line, because many themes and plugins use that endpoint for front-end functionality that Google needs to render.

    Will robots.txt remove a page from Google?

    No. Blocking a URL stops crawling, but the page can still be indexed from external links. To remove a page, allow crawling and add a noindex meta tag so Google can see the instruction to drop it.

    Do I need a robots.txt file at all?

    Not strictly — a site with no robots.txt is crawled normally. But a good one saves crawl budget on junk URLs and points bots to your sitemap, so it is worth having on any WordPress site.

    Where do I add the sitemap in robots.txt on WordPress?

    Add a line Sitemap: https://yoursite.com/wp-sitemap.xml (or your plugin’s sitemap URL) anywhere in the file — it is not tied to a User-agent block. Point it at whichever sitemap your site actually serves.

    The short version

    For most WordPress sites, the default robots.txt is nearly right — the wins come from a few careful additions (block internal search and store-only URLs, always include your sitemap) and, more importantly, from not making the classic mistakes: never block CSS/JS or /wp-content/, never leave a staging Disallow: / in place, and never confuse robots.txt with noindex. Get those right, verify in Search Console, and you can safely forget about the file for years.

    Ready to build yours? Generate a valid file in seconds with the Robots.txt Generator, pair it with the XML Sitemap Generator, and if you want the full background, read The Complete Robots.txt Guide 2026.

  • The Complete Robots.txt Guide 2026

    The Complete Robots.txt Guide 2026

    The first time robots.txt cost me traffic, I didn’t even know it happened. A staging site went live with a single leftover line — Disallow: / — and for almost two weeks Google politely stayed away from the entire thing. No error, no warning, just a slow, confusing slide in impressions until I finally opened the file and felt my stomach drop.

    That’s the strange thing about robots.txt. It’s one of the smallest files on your website — often just a few lines of plain text — yet it sits at the very front door of how search engines see you. Get it right and it quietly does its job for years. Get one character wrong and you can hide your whole site from Google without realizing it.

    This guide walks through everything, from the absolute basics to the advanced edge cases. Whether you run a WordPress blog, a Shopify store, or a custom-built app, by the end you’ll understand exactly what to put in your robots.txt file, what to keep out of it, and how to check your work before it goes live.

    What is robots.txt?

    Robots.txt is a plain text file that lives in the root folder of your website. Its job is to tell automated visitors — search engine crawlers, bots, and scrapers — which parts of your site they’re allowed to request and which parts they should leave alone.

    When a well-behaved crawler like Googlebot arrives at your site, the first thing it does is look for a file at a very specific address:

    https://yourdomain.com/robots.txt

    If it finds one, it reads the rules before crawling anything else. If it doesn’t find one, it assumes everything is fair game and crawls whatever it can reach. That’s an important point people miss: no robots.txt file means “crawl everything,” not “crawl nothing.”

    The name is short for “robots exclusion” and the format is governed by the Robots Exclusion Protocol, a standard that’s been around since 1994 and was finally formalized by the IETF in 2022. Every major search engine respects it.

    Robots.txt is a request, not a lock. Good bots obey it. Malicious bots and scrapers can — and do — ignore it completely. Never use robots.txt to hide sensitive information; use passwords and proper access control for that.

    Why robots.txt matters for SEO

    You might be wondering why you’d ever want to stop search engines from crawling parts of your site. Isn’t more crawling better? Not always. Here’s why the file matters.

    It protects your crawl budget

    Search engines don’t crawl every page on every site on every visit. They allocate a rough budget of how many pages they’ll fetch from you in a given window. If a big chunk of that budget gets spent on pages that don’t matter — internal search results, filter combinations, admin URLs — your genuinely important pages get crawled less often. Robots.txt lets you steer crawlers away from the low-value stuff.

    It keeps clutter out of the crawl path

    Most sites generate a surprising number of throwaway URLs: session parameters, faceted navigation, print versions, staging directories. Blocking these keeps crawlers focused on the content you actually want ranked.

    It points crawlers to your sitemap

    Robots.txt is also the conventional place to announce where your XML sitemap lives, which helps search engines discover your important pages faster. We’ll cover that pairing in detail later.

    It prevents server strain

    On large or resource-heavy sites, aggressive crawling can slow things down for real visitors. Thoughtful robots.txt rules reduce unnecessary requests.

    The flip side is the danger I opened with: because robots.txt is so powerful, a careless rule can deindex pages you desperately want ranked. Respect it, test it, and change it deliberately.

    Robots.txt syntax explained

    The good news is that the syntax is genuinely simple. A robots.txt file is a list of rules, and each rule has two parts: who the rule applies to, and what they can or can’t do.

    Here is the smallest useful example:

    User-agent: *
    Disallow: /private/

    Read out loud, that says: “To every crawler (* means all of them), you are not allowed to crawl anything inside the /private/ folder.” Everything else on the site is allowed by default.

    A few rules of the road for the format itself:

    • Each directive goes on its own line.
    • Directive names are not case-sensitive (User-agent and user-agent both work), but the paths you list are case-sensitive.
    • Lines starting with # are comments and are ignored by crawlers — use them to leave notes for yourself.
    • Paths are relative to the root, always starting with a /.
    • A blank line separates one rule group from the next.

    The common directives

    You only need to understand four directives to handle 95% of real-world situations. Let’s take them one at a time.

    User-agent

    This line names the crawler a rule group applies to. The asterisk * is a wildcard meaning “all crawlers.” You can also target specific bots by name:

    # Rules for everyone
    User-agent: *
    Disallow: /cart/
    
    # A special rule just for Google's image crawler
    User-agent: Googlebot-Image
    Disallow: /private-photos/

    Some crawler names worth knowing: Googlebot (Google’s main crawler), Bingbot (Microsoft Bing), Googlebot-Image, and increasingly the AI crawlers like GPTBot and ClaudeBot that fetch content for large language models.

    Disallow

    This tells the named crawler not to request URLs that begin with the given path. A few examples make the pattern clear:

    Disallow: /admin/        # blocks the whole /admin/ folder
    Disallow: /search        # blocks any URL starting with /search
    Disallow: /*.pdf$        # blocks every URL ending in .pdf
    Disallow:                # an empty Disallow blocks nothing — allows all

    Notice the last one. An empty Disallow: value is the standard way to say “this crawler may access everything.”

    Allow

    Allow is the exception-maker. It’s most useful when you’ve blocked a whole folder but want to permit one specific thing inside it:

    User-agent: *
    Disallow: /wp-admin/
    Allow: /wp-admin/admin-ajax.php

    That blocks the entire WordPress admin area except the one file that themes and plugins legitimately need crawlers to reach. When rules conflict, most modern crawlers follow the most specific (longest) matching path, so the Allow wins here.

    Sitemap

    The Sitemap directive announces the full URL of your XML sitemap. Unlike the others, it isn’t tied to any user-agent — it’s a standalone line, usually placed at the bottom of the file:

    Sitemap: https://yourdomain.com/sitemap.xml

    You can list more than one sitemap line if you have multiple sitemaps. Always use the full, absolute URL here, not a relative path.

    A note on Crawl-delay

    You may see Crawl-delay: 10 in older files, meant to tell a crawler to wait ten seconds between requests. Be aware that Google ignores this directive entirely — you control Google’s crawl rate in Search Console instead. Bing and a few others still honor it, so it’s not useless, just misunderstood.

    WordPress robots.txt examples

    WordPress is where most people meet robots.txt for the first time. By default WordPress generates a small virtual file for you, but the moment you want real control you’ll want your own. Here’s a sensible, safe starting point for a typical WordPress site:

    User-agent: *
    Disallow: /wp-admin/
    Allow: /wp-admin/admin-ajax.php
    Disallow: /?s=
    Disallow: /search/
    
    Sitemap: https://yourdomain.com/wp-sitemap.xml

    What each line is doing:

    • Disallow: /wp-admin/ keeps crawlers out of the dashboard.
    • Allow: /wp-admin/admin-ajax.php re-opens the one file plugins need.
    • Disallow: /?s= and /search/ stop internal search-result pages from being crawled — these are classic crawl-budget wasters.
    • The Sitemap line points to WordPress’s built-in sitemap.

    Notice what’s not here. You’ll sometimes find old tutorials telling you to block /wp-content/ or /wp-includes/. Don’t. Modern Google needs to fetch your CSS and JavaScript from those folders to render and understand your pages. Blocking them can actively hurt your rankings.

    Shopify robots.txt examples

    Shopify is a different story, and it trips people up. On Shopify you don’t have full free-form access to the file the way you do on a self-hosted site. Shopify generates a solid default robots.txt automatically — one that already blocks carts, checkout, and internal search — and for most stores you should simply leave it alone.

    Since 2021, Shopify does let you customize it through a robots.txt.liquid template if you’re on a plan that allows theme code edits. A typical customization looks like adding or removing a rule inside that template rather than writing the file from scratch:

    {% comment %} Block a collection filter that creates duplicate URLs {% endcomment %}
    {%- if group.user_agent.value == '*' -%}
      {{ 'Disallow: /collections/*?*sort_by*' }}
    {%- endif -%}

    Shopify’s default already handles the important exclusions — /cart, /checkout, /account, and search. The main reasons to touch it are blocking messy filtered collection URLs or removing a rule Shopify added that’s blocking something you actually want crawled. If you’re not comfortable editing Liquid, the safe move is to leave the default in place; it’s genuinely well-designed.

    WooCommerce robots.txt examples

    WooCommerce runs on top of WordPress, so you get full control again — and a store adds a few URLs worth managing. Cart, checkout, and account pages hold nothing a search engine needs to index, and blocking them keeps crawlers on your products and categories:

    User-agent: *
    Disallow: /wp-admin/
    Allow: /wp-admin/admin-ajax.php
    Disallow: /cart/
    Disallow: /checkout/
    Disallow: /my-account/
    Disallow: /*add-to-cart=*
    Disallow: /?orderby=
    Disallow: /?filter_*
    
    Sitemap: https://yourstore.com/wp-sitemap.xml

    The two lines to pay attention to are the parameter blocks. /*add-to-cart=* stops crawlers from following those “add to cart” action links, and /?orderby= and /?filter_* keep them out of the endless sorted-and-filtered variations of your shop pages. Those parameter URLs can multiply into thousands of near-identical pages — exactly the kind of thing that drains crawl budget on a busy store.

    One caution specific to stores: never block /product/ or your shop and category pages. It sounds obvious written down, but it’s a mistake I’ve seen happen when someone copies an overly aggressive rule set from a forum.

    Common mistakes and how to avoid them

    Most robots.txt disasters come from a small handful of mistakes. Here are the ones worth burning into memory.

    1. Accidentally blocking the whole site

    The single most damaging line in existence:

    User-agent: *
    Disallow: /

    That forward slash means “the root and everything under it.” It’s the exact line that hid my staging site. It belongs on development servers and nowhere else. If your traffic ever falls off a cliff for no obvious reason, this is the first thing to check.

    2. Using robots.txt to hide a page from search results

    This is the most common misconception in all of SEO. Blocking a URL in robots.txt stops crawling, but it does not guarantee the page stays out of Google’s index. If other sites link to that URL, Google can still list it in results — just without a description, showing “No information is available for this page.” To truly keep a page out of search, use a noindex meta robots tag and allow crawling so Google can see the tag. More on that difference below.

    3. Blocking CSS and JavaScript

    Google renders pages like a browser does. If you block the resources it needs to render — stylesheets, scripts, fonts — it sees a broken version of your page and may judge it poorly. Let crawlers reach your assets.

    4. Getting case wrong

    Paths are case-sensitive. Disallow: /Blog/ will not block /blog/. Match your real URLs exactly.

    5. Forgetting the file after a site migration

    When you move from staging to production, the staging robots.txt often comes along for the ride, complete with its Disallow: /. Migration checklists exist for a reason — put “review robots.txt” near the top of yours.

    How to test a robots.txt file

    Never publish a robots.txt change and just hope. Testing takes two minutes and saves weeks of grief.

    1. View the live file. Type your domain followed by /robots.txt into a browser. What you see is exactly what crawlers see.
    2. Use Google Search Console. Search Console reports whether Google can fetch your robots.txt and flags syntax problems. The URL Inspection tool also tells you if a specific page is blocked from crawling.
    3. Test individual URLs. Before you trust a new rule, confirm that the URLs you meant to block are blocked — and, just as importantly, that the ones you meant to keep are still allowed.
    4. Validate the syntax. A misplaced character can silently break a rule. Running your file through a validator catches problems a quick glance misses.

    If you’d rather not hand-write the file at all, you can generate a clean, correctly formatted one in a couple of clicks with the free ToolBrainy Robots.txt Generator — pick your rules, and it writes valid syntax for you.

    Robots.txt vs meta robots

    This is the distinction that separates people who understand crawling from people who guess at it. Robots.txt and the meta robots tag sound similar and are constantly confused, but they do genuinely different jobs.

    Robots.txt Meta robots tag
    A file at your site root A tag inside a page’s HTML <head>
    Controls crawling (whether a bot fetches the URL) Controls indexing (whether a fetched page appears in results)
    Applies to files, folders, and URL patterns Applies to a single page
    Cannot reliably remove a page from the index Can remove a page from the index with noindex

    Here’s the practical takeaway: to keep a page out of Google, use noindex, and do not block it in robots.txt. Those two instructions fight each other — if you block crawling, Google never fetches the page, so it never sees the noindex tag telling it to drop the page. The meta tag lives in the page’s head like this:

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

    Use robots.txt to manage crawling at scale (whole folders, parameters, budget). Use meta robots to control the indexing of specific pages. You can check what meta tags a page is actually serving with the ToolBrainy Meta Tag Analyzer.

    Robots.txt and XML sitemaps

    Robots.txt and your XML sitemap are two halves of the same conversation. Robots.txt tells crawlers where not to go; the sitemap tells them where you’d most like them to go. They work best together.

    Linking your sitemap from robots.txt is a small step with a real payoff — it helps search engines discover your important URLs without waiting to stumble across them through internal links:

    User-agent: *
    Disallow: /wp-admin/
    Allow: /wp-admin/admin-ajax.php
    
    Sitemap: https://yourdomain.com/sitemap.xml

    One rule that catches people out: never list a URL in your sitemap that you’ve blocked in robots.txt. You’d be sending a mixed signal — “please crawl this” and “don’t crawl this” about the same page. Keep the two files consistent. If you need to build or refresh your sitemap, the ToolBrainy Sitemap Generator produces a valid XML file you can point to from this exact directive.

    Crawl budget considerations

    “Crawl budget” is one of those phrases that sounds intimidating and turns out to be simple. It’s just the number of pages a search engine is willing to crawl on your site within a given timeframe, shaped by two things: how much crawling your server can handle without slowing down, and how much Google actually wants to crawl based on your site’s importance and freshness.

    For most small sites — a few hundred pages — crawl budget is a non-issue. Google will happily crawl everything. It starts to matter when you have:

    • Tens of thousands of URLs or more.
    • Lots of auto-generated pages (faceted navigation, filters, calendars, internal search).
    • A large store with countless product-variant and sort-order URLs.

    On sites like those, robots.txt becomes a budget tool. By blocking the low-value, near-duplicate, and infinite-URL traps, you concentrate crawling on the pages that earn you traffic. Think of it as clearing the path so crawlers spend their limited time on your best work rather than wandering through filter combinations no human will ever search for.

    A few habits that protect crawl budget: block internal search results, block obvious parameter clutter, keep your sitemap clean and current, and fix or redirect long chains of broken and redirected URLs so crawlers aren’t chasing dead ends.

    Frequently asked questions

    Where should the robots.txt file be located?

    It must live in the root directory of your domain and be reachable at https://yourdomain.com/robots.txt. Crawlers only look in that exact spot — a robots.txt file placed in a subfolder is ignored. Each subdomain needs its own file too; blog.yourdomain.com uses its own robots.txt, separate from the main domain.

    Do I even need a robots.txt file?

    Not strictly. If you’re happy for search engines to crawl your entire site, you can skip it and nothing breaks. That said, having one is good practice — it lets you point to your sitemap, block low-value URLs, and gives you a place to make crawl decisions later. A simple, permissive file is better than none.

    Will robots.txt keep my page out of Google?

    No, not reliably. Blocking a URL stops crawling, but the page can still appear in search results if other sites link to it. To truly keep a page out of the index, use a noindex meta robots tag and allow crawling so Google can read that tag.

    How often do search engines check robots.txt?

    Google typically caches your robots.txt for up to 24 hours, so changes usually take effect within a day. If you’ve made an urgent fix, you can prompt a faster re-fetch through Google Search Console rather than waiting.

    Can I block AI crawlers like GPTBot in robots.txt?

    Yes. AI crawlers that respect the standard — such as GPTBot and ClaudeBot — read robots.txt like any other bot. Add a rule group naming the crawler and disallow what you want. Keep in mind this only works for bots that choose to obey; it isn’t an enforceable block.

    What happens if my robots.txt has a syntax error?

    Crawlers are fairly forgiving and will ignore lines they can’t parse, applying the rest. The danger is subtler: a malformed rule might silently fail to block what you intended, or an overly broad one might block more than you meant. That’s exactly why testing and validating before publishing is worth the two minutes.

    Bringing it all together

    Robots.txt rewards a little bit of care and punishes carelessness, which is why it’s worth understanding properly rather than copying a random file off a forum. Remember the essentials: it controls crawling, not indexing; an empty or missing file means “crawl everything”; a lone Disallow: / can hide your whole site; and it should always be kept in sync with your XML sitemap.

    Start simple. Block the genuinely useless URLs — admin areas, internal search, cart and checkout on stores — point to your sitemap, and leave your real content and assets fully crawlable. Test the file, watch Search Console for a week, and adjust only when you have a specific reason to.

    Do that, and this tiny text file becomes exactly what it’s meant to be: a quiet, reliable doorman that sends crawlers straight to your best pages and keeps them out of the clutter. If you’d rather skip the hand-editing, the free Robots.txt Generator builds a valid file for you in seconds, and pairing it with the Sitemap Generator, Meta Tag Analyzer, and SERP Preview gives you a complete, no-signup technical-SEO toolkit to get the rest right too.