The Ultimate Robots.txt Guide for Webmasters

clock Aug 13,2026
pen By SEO ANALYSER
The Ultimate Robots.txt Guide for Webmasters

Written by Sam Holloway, Small Business SEO Educator

Sam Holloway spent five years running his own trade business in Perth before teaching himself SEO. He writes for business owners figuring this out on their own, without agency budgets or technical backgrounds.

You've probably heard the words robots.txt file thrown around in some small business Facebook group, or by a mate who reckons they "do SEO", and felt a bit lost. Maybe you've even opened your website's files, spotted one sitting there, and had no idea what it actually does or whether you're allowed to touch it. Sound familiar? You're not alone.

When I had my own trade business in Perth, I ignored mine for years because it looked too technical to bother with. The truth is, a robots.txt file is one of the simpler parts of your website to understand once someone walks you through it properly. That's exactly what this guide does, without the jargon and without assuming you're a developer.

What a Robots.txt File Actually Does

A robots.txt file is a small text file that sits on your website and gives instructions to search engine crawlers, the automated programs (like Googlebot) that visit your site to read its pages. Think of it like a note stuck to your shop door, telling delivery drivers which rooms they can walk into and which ones are off limits.

Every website can have one, though not every website needs one. The file doesn't hide pages from people browsing your site. It tells crawlers which parts of your site you'd rather they skip, so they spend their crawl budget, the number of pages a crawler will bother visiting in one session, on the pages that actually matter to your business.

This matters more for larger sites with hundreds of pages than it does for a five-page café website, but it's still worth understanding for every site owner.

How Search Engine Crawlers Read Your Robots.txt File

Before a crawler works through your website, it checks for a robots.txt file first. If it finds one, it reads the rules inside before deciding where to go next. If there's no file at all, most crawlers assume they can access everything on the site.

It's worth knowing that these rules are a request, not a lock. Well-behaved crawlers from Google, Bing, and similar search engines generally respect the file. Poorly behaved bots, the kind scraping content or hunting for security gaps, often ignore it completely. That's an important distinction: robots.txt manages crawling, it doesn't protect private information. If you have something genuinely sensitive on your site, password protection is the right tool, not a text file.

How to Create a Robots.txt File

This is the part most business owners get stuck on, so let's go through it step by step.

You don't need any special software to create a robots.txt file. It's a plain text file, the same kind you'd make in Notepad or TextEdit, saved with the exact filename "robots.txt" in lowercase letters. Nothing fancy, no coding program required.

Inside the file, you write simple instructions using a small set of terms: which crawler the rule applies to, and which folders or pages it should avoid. A very basic file for a small business site might look like this:

User-agent: *
Disallow: /admin/
Sitemap: https://www.example.com.au/sitemap.xml

That first line applies the rule to every crawler. The second line blocks the admin folder, the backend area where you log in to manage your site, something no search visitor ever needs to see. The third line points crawlers toward your XML sitemap, a file listing every page you want indexed.

Once your file is written, it needs to sit in the right spot for crawlers to find it, which we'll cover shortly. If you run your site through WordPress, Shopify, or a similar platform, there's often a built-in tool for editing this file without touching any code directly, which makes the whole process far less intimidating than it sounds.

Pro tip: Start simple. Block only the folders you're genuinely sure about, like admin or checkout areas, and leave everything else open. You can always add more rules later once you're comfortable reading them.

Understanding Robots.txt Syntax and Directives

Once you know the basic robots.txt syntax, the handful of terms used to write rules, the rest becomes far less confusing. Here's a simple breakdown of what each one does.

DirectiveWhat It Does
User-agentNames which crawler the rule below applies to (use * for all crawlers)
DisallowTells the crawler not to visit a specific page or folder
AllowCreates an exception inside a blocked folder
SitemapPoints crawlers to your XML sitemap so they can find your pages faster

The User-agent line always comes first, followed by one or more rules underneath it. A Disallow directive blocks access, while an Allow directive works the opposite way, letting a specific page through even if it sits inside a folder you've otherwise blocked. You might use this if you've blocked an entire images folder but still want one product photo crawled for Google Images.

Robots.txt Rules: Pages You Should and Shouldn't Block

Deciding what to include in your file is really the whole point of learning robots.txt rules in the first place. Some pages are worth keeping away from crawlers, while others should always stay open, even if blocking them feels tempting.

Pages commonly worth blocking include:

  • Admin or login areas that customers never see
  • Internal search result pages, which create endless duplicate URLs
  • Staging or test versions of your site
  • Shopping cart and checkout steps that don't need to appear in search results
  • Duplicate filtered or sorted product listing pages on online stores

Pages you should almost never block include your homepage, your main service or product pages, your blog posts, and the CSS and JavaScript files that help your site display properly. Blocking those by mistake is one of the most common issues small business owners run into, which brings us to the next section.

Common Robots.txt Mistakes That Hurt Small Business Websites

Most robots.txt problems come from good intentions gone slightly wrong. A boutique owner trying to tidy up her site once blocked her entire images folder, not realising her product photos would stop showing up in Google Image searches as a result. It's an easy mistake to make when you're not sure what each line actually controls.

The most damaging error is blocking important pages by accident, often through a rule that's broader than intended, like disallowing an entire folder when only one page inside it needed hiding. Another common slip is forgetting to update the file after a website redesign, leaving old rules pointing at folders that no longer exist, or worse, blocking new pages that should be visible.

Common mistake: Copying a robots.txt file from another website without checking what its rules actually block. What worked for someone else's site structure might quietly hide your most important pages from Google.

Robots.txt vs the Meta Robots Tag

These two get confused constantly, so it's worth clearing up quickly. A robots.txt file controls whether a crawler visits a page at all. A meta robots tag, a small piece of code placed inside an individual page, controls whether that page gets indexed once the crawler has already read it.

If you block a page in robots.txt, Google generally won't crawl it, but it can sometimes still appear in search results without any description if other sites link to it. If you want a page fully removed from Google's results, the meta robots tag is usually the better tool for that specific job.

Where to Put Your File and How to Test It

Your robots.txt file needs to live in the root directory of your website, meaning the main top-level folder, not tucked inside a subfolder. It should be reachable at yourdomain.com.au/robots.txt exactly, nothing extra in the address.

Once it's uploaded, it's worth taking a moment to test your robots.txt before assuming everything's fine. Google Search Console includes a simple checking tool for this, letting you paste in a URL and see whether your current rules block or allow it. Running this check after any changes takes a couple of minutes and can save you from an accidental mistake sitting unnoticed for months.

Do You Even Need a Robots.txt File?

For a lot of small, straightforward websites, the honest answer is that a basic file helps but isn't strictly essential. If your site has no admin folders, no duplicate pages, and nothing you'd rather keep away from crawlers, a simple file pointing to your sitemap is often enough.

Larger sites, online stores, and anything built on a platform that generates lots of automatic pages tend to benefit more, since there's usually more worth tidying up behind the scenes.

FAQs

01
What happens if my website doesn't have a robots.txt file at all?
Nothing breaks. Without one, crawlers generally assume they're allowed to access your entire site. It's not compulsory, but adding a basic file still helps guide crawlers toward your XML sitemap and away from folders you'd rather keep tidy.
02
Can I block a page from Google using robots.txt alone?
Not reliably. Robots.txt stops crawling, but a blocked page can occasionally still turn up in search results without a proper description. If you want a page fully removed from indexed in search results, use a noindex tag instead, or combine both approaches carefully.
03
Do robots.txt rules use wildcard characters?
Yes. Most search engines support wildcard characters like the asterisk symbol, which lets you block groups of similar URLs, such as every page inside a particular category, without writing a separate rule for each one individually.
04
Is robots.txt the same for every search engine?
Mostly, yes, though some crawlers recognise slightly different optional directives. The core rules, User-agent, Disallow, and Allow, are widely supported. If you're unsure, stick to the basics and avoid unusual directives aimed at just one specific search engine.
05
Will editing my robots.txt file affect my Google rankings straight away?
Not immediately, and not dramatically in most cases. Crawling changes take time to filter through, since Google needs to revisit your site first. Results can vary depending on how often your site is crawled and how significant the change was.
06
How often should I check my robots.txt file?
Whenever you redesign your site, change platforms, or add new sections. It's easy to forget about once it's set up, but outdated rules can quietly cause problems, so a quick check after any major site change is a sensible habit.

Summary

A robots.txt file doesn't need to feel technical or intimidating once you understand what it's actually doing: guiding search engine crawlers toward the pages that matter and away from the ones that don't. Getting the basics right, correct placement in your root directory, sensible rules, and a quick test after any changes, covers most of what a small business site will ever need.

You don't need to overhaul everything at once. Start with a simple file, block only what you're confident about, and build from there as your site grows. Understanding robots.txt properly means you're already ahead of plenty of business owners who've never looked at their file at all, and that's a solid step toward a site that search engines can read the way you intended.

SEO ANALYSER
Popular Tags

Create your account