Table of Contents show

A single line in your robots.txt file can prevent Googlebot from accessing every service page, product listing and article on your website. The pages may still work perfectly for customers, making the problem difficult to spot during a routine website check.

Singapore businesses preparing a website relaunch or managing a growing online catalogue need clear rules for crawler access, especially where service pages and product categories generate enquiries and sales. A practical robots.txt guide helps separate crawl restrictions from indexing controls and authentication.

At MediaOne, we approach crawl management as part of technical SEO and website maintenance. Start by identifying the pages your business needs search engines to access. By the end, you will be able to write, test and maintain robots.txt rules that support those priorities.

Key Takeaways

  • Robots.txt controls crawling, and blocked page URLs can still appear in search results if search engines discover them through other sources.
  • Use a noindex directive to prevent eligible pages from appearing in search results while keeping them accessible to crawlers.
  • Keep crawl restrictions specific to unnecessary URLs, such as selected internal search results and duplicate sorting pages.
  • A misplaced slash or overly broad directive can prevent search engines from accessing entire sections of your website.
  • Include an absolute sitemap URL in your robots.txt file to support content discovery.
  • Test proposed rules before deployment and verify the published file using Google Search Console.
  • Review robots.txt after website migrations, platform upgrades and changes to URL structures.

Robots.txt Guide to Creating and Editing Rules

Creating a robots.txt file requires little technical knowledge, but deciding which URLs to restrict requires an understanding of your website. Before editing anything, identify the pages that support organic traffic, customer enquiries and product discovery.

Follow these five steps to create or update your file.

Step 1: Save Your Existing Robots.txt File

Open your website’s /robots.txt address in a browser and copy its contents into a plain text editor. Save a dated backup so your development team can restore the previous configuration if an issue occurs.

If you use WordPress or another content management system (CMS), check how your website generates the file. Your CMS, SEO plugin or hosting configuration may already manage it.

Step 2: Define Your Crawling Rules

Start each rule group with a User-agent directive. Add the relevant Disallow and Allow instructions underneath.

For example:

User-agent: *
Disallow: /internal-search/
Disallow: /account/

This configuration asks compliant crawlers to avoid the two specified directories. All other paths remain available for crawling unless another applicable rule restricts them.

These are illustrative paths. Replace them with directories that exist on your website and have a genuine reason for restricting crawler access.

Step 3: Add Your Sitemap URL

Include the full URL of your XML sitemap, including the HTTPS protocol and hostname.

Sitemap: https://www.example.com/sitemap.xml

Check that the sitemap opens successfully and contains the preferred URLs you want search engines to discover.

Step 4: Upload Your Robots.txt File

Publish the file at the root of the relevant website hostname. The filename must be robots.txt, written in lowercase.

Your website should make it available at an address such as:

https://www.example.com/robots.txt

Google provides official instructions for creating and publishing robots.txt files, including guidance for different hosting configurations.

Step 5: Test and Verify Your Rules

Use a robots.txt parser or compatible crawling tool to test the proposed configuration before publishing it. Include your homepage, important landing pages, product categories and any restricted directories in your test.

After deployment, open the live file in your browser and review its status in Google Search Console. Check individual URLs to confirm that Google can access the pages intended for search.

Five hotel door hangers showing the steps in this robots.txt guide, from backing up the file to testing the rules

What Is Robots.txt and Its Purpose?

Robots.txt is a plain text file containing instructions that compliant web crawlers use to determine which URLs they may request on a website.

The file follows the Robots Exclusion Protocol (REP), formally documented in RFC 9309. Website owners use it to manage automated crawling across specific sections of a site.

Understanding the Robots Exclusion Protocol

Search engines use automated programmes called crawlers to discover and retrieve online content. Googlebot is Google’s crawler for Search, while Bingbot performs similar functions for Bing.

Robots.txt provides these crawlers with access instructions. A website owner can permit crawling across the entire site or restrict requests to selected directories and URL patterns.

However, the protocol depends on crawlers respecting its instructions. It cannot enforce access restrictions against automated programmes that ignore them.

Confidential documents, customer records and restricted business information require authentication or other server-level access controls.

Is a Robots.txt File Required?

A robots.txt file is optional. Google generally assumes crawling is unrestricted when a website returns a 404 Not Foundresponse for its robots.txt file.

A small Singapore consultancy with a homepage, several service pages and a blog may need few crawl restrictions. An e-commerce business generating filtered product listings may require more detailed rules.

The appropriate configuration depends on the website’s structure and the purpose of its URLs. Adding unnecessary restrictions introduces technical risk without a clear benefit.

Where to Find Your Robots.txt File

Enter your website’s homepage address followed by /robots.txt into your browser.

For example:

https://www.example.com/robots.txt

The file’s scope depends on its protocol, hostname and port. A file hosted on www.example.com does not automatically govern shop.example.com.

Businesses operating separate storefronts, regional subdomains or customer portals should check each relevant hostname individually.

Robots.txt Guide to Syntax and Directives

A robots.txt file contains groups of instructions identifying crawlers and the paths they may access. Save the file as UTF-8 plain text and place each instruction on a separate line.

Directive names are case-insensitive, while URL path values are case-sensitive. An instruction targeting /Products/ may produce a different result from one targeting /products/.

The Main Robots.txt Directives

Directive Purpose Example
User-agent Identifies the crawler receiving the instructions User-agent: Googlebot
Disallow Restricts crawling of matching paths Disallow: /admin/
Allow Permits crawling of a matching path Allow: /admin/public/
Sitemap Identifies the location of an XML sitemap Sitemap: https://example.com/sitemap.xml
Crawl-delay Requests a delay between crawler requests where supported Crawl-delay: 5

Google supports the first four directives in this table. It does not support Crawl-delay.

User-Agent Groups and Crawler Selection

The User-agent directive identifies the crawler to which a group of rules applies.

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

The asterisk identifies the general group for crawlers without a more specific applicable group.

You can create separate instructions for a named crawler:

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

User-agent: Googlebot
Disallow: /internal-search/
Disallow: /duplicate-listings/

Googlebot follows the specific group written for it. Other compliant crawlers without their own matching group follow the general instructions.

Google does not automatically combine the general group with a named crawler’s group. Repeat any shared restrictions in the specific group when necessary.

Allow and Disallow Instructions

A Disallow directive prevents compliant crawlers from fetching matching URLs. An Allow directive creates permission for a matching path, including exceptions within restricted directories.

For example:

User-agent: *
Disallow: /resources/
Allow: /resources/public/

This configuration restricts the resources directory while permitting access to its public subdirectory.

A Disallow directive with an empty value creates no restriction:

User-agent: *
Disallow:

By comparison, Disallow: / restricts crawling across the entire website for the applicable crawler group.

Understanding the Crawl-Delay Directive

Crawler support for Crawl-delay varies. Bing supports it, while Google ignores it.

Bing provides a crawler management and crawl error reporting system for investigating excessive or insufficient crawling.

If automated requests are affecting website performance, examine server logs and hosting capacity before changing crawler settings. Establish which crawler is creating the problem and use the controls appropriate to that service.

Pattern Matching and URL Path Precision

Robots.txt rules match URL paths according to defined patterns. A small change to a rule can affect an entire group of pages, making precision particularly important for websites with extensive product catalogues.

Two useful special characters are the asterisk (*) and the dollar sign ($).

Using Wildcards in Robots.txt

An asterisk matches a sequence of zero or more characters. It allows website owners to restrict multiple URLs that share a particular pattern.

For example:

Disallow: /*.pdf$

This rule matches URLs ending in .pdf.

Another example targets URLs containing a sorting parameter:

Disallow: /*?*sort=

This can match addresses such as:

  • /shoes?sort=price
  • /shoes?colour=black&sort=price
  • /bags?sort=newest

Test parameter-based rules against your actual URL structure. A broad pattern can accidentally restrict pages that provide distinct content or attract relevant search traffic.

Anchoring Rules to URL Endings

The dollar sign identifies the end of a URL for pattern matching purposes.

Compare these two instructions:

Disallow: /*.pdf
Disallow: /*.pdf$

The first can also match a URL such as /guide.pdf-archive/page. The second targets URLs ending in .pdf, so a PDF address followed by a query string may remain crawlable.

Use end-of-URL matching when the restriction should apply to a particular ending. Avoid adding it without checking how your website constructs its URLs.

Understanding Path Matching and Trailing Slashes

Robots.txt rules match from the beginning of the URL path. A trailing slash can change which pages fall under a restriction.

Rule Example URL Result
Disallow: /blog /blog Blocked
Disallow: /blog /blog-news Blocked
Disallow: /blog/ /blog/article/ Blocked
Disallow: /blog/ /blog-news/ Allowed
Disallow: /blog/ /blog Allowed

These outcomes assume that no other applicable rule changes the result.

A business restricting an old /blog/ directory may still want its /blog-news/ section available in search. Checking path boundaries helps prevent unintended restrictions.

Allow and Disallow Rule Precedence

Google applies the most specific matching rule when Allow and Disallow instructions overlap. If conflicting matches are equally specific, Google favours the less restrictive instruction.

Consider this example:

User-agent: *
Disallow: /shop/
Allow: /shop/sale/

The /shop/sale/ path remains accessible to Googlebot because its matching instruction is more specific.

Google’s robots.txt specification and rule-matching documentation provides further examples of group selection and conflicting directives.

We recommend testing individual URLs whenever rules overlap. A file that appears correct during a visual review can behave differently once a parser evaluates the matching instructions.

Sitemap Directive Setup and Submission

A sitemap helps search engines discover the URLs a website owner considers important. Robots.txt manages crawler permissions, while a sitemap identifies preferred content for discovery.

Using both provides clearer instructions about your website’s structure.

Writing the Sitemap Directive

A sitemap declaration requires an absolute URL:

Sitemap: https://www.example.com/sitemap.xml

A relative address such as /sitemap.xml is insufficient for this directive.

Place the declaration after your crawler rule groups to make the file easier to read. Google treats sitemap declarations independently of individual user-agent groups.

You can also declare multiple sitemap URLs:

Sitemap: https://www.example.com/products.xml
Sitemap: https://www.example.com/articles.xml

Check that each declared sitemap exists and is accessible to the intended crawler.

Submitting Your Sitemap to Search Engines

Search engines can discover sitemaps through robots.txt. Submitting a sitemap directly through their webmaster tools gives website owners access to processing information and reported errors.

For Google Search Console:

  1. Select the relevant website property.
  2. Open the Sitemaps report.
  3. Enter your sitemap address in the submission field.
  4. Submit the sitemap and review its processing status.

Bing Webmaster Tools also provides a sitemap submission facility.

A successful submission helps search engines discover URLs, but it does not guarantee crawling, indexing or rankings.

Confirming Your Sitemap Has Been Processed

Google’s Sitemaps report documentation explains the available processing statuses and how to investigate reported errors.

Sitemap Status Meaning Recommended Action
Success Google processed the sitemap without errors Review discovered URLs and indexing coverage
Couldn’t fetch Google could not retrieve the sitemap Investigate accessibility, URL accuracy and reported errors
Has errors Google encountered processing errors Review the details and correct affected entries

A successful sitemap status does not establish that every listed page has entered Google’s index.

Compare sitemap discovery data with the Page indexing report. Investigate important pages individually before concluding that your website has an indexing problem.

Sitemap Index Files for Larger Websites

A single sitemap can contain up to 50,000 URLs and have an uncompressed size of up to 50 MB.

Websites exceeding either limit can divide their URLs into separate sitemap files and reference those files through a sitemap index.

Sitemap: https://www.example.com/sitemap_index.xml

A retailer could organise sitemaps by product categories, individual products and editorial content. This arrangement can make website sections easier to monitor.

Google’s sitemap creation requirements explain the technical limits and supported formats.

Crawling, Indexing and Crawl Budget Control

Crawling, indexing and ranking describe different parts of the search process. Understanding their relationship helps website owners choose the correct technical controls.

How Search Engine Crawlers Process Websites

Crawlers discover URLs through sources such as links and sitemaps. Before fetching content, compliant crawlers consult the applicable robots.txt instructions, which may already be cached.

When Google accesses an eligible page, it can process its content and evaluate it for indexing. Indexed content may subsequently appear in relevant search results.

Search Process What Happens Relevant Controls
Discovery Search engines become aware of URLs Internal links and sitemaps
Crawling Crawlers request website content Robots.txt and server accessibility
Indexing Search engines process eligible content for possible inclusion Noindex and canonical signals
Ranking Search engines determine which results to display Relevance, quality and other ranking systems

Allowing a page to be crawled creates an opportunity for further processing. It does not guarantee index inclusion or a particular ranking position.

Using Robots.txt to Manage Crawl Budget

Crawl budget describes the crawling resources Google can and wants to allocate to a website. Server capacity, URL inventory, content changes and crawl demand can influence this allocation.

Google’s crawl budget guidance for large websites focuses on sites with extensive or frequently updated URL inventories.

Potential candidates for crawl restrictions include:

  • Duplicate sorting variations of product listings.
  • Unnecessary internal search result pages.
  • Filter combinations without independent search value.
  • Publicly accessible utility directories that crawlers do not need.

A Singapore professional services website with a limited number of pages may have little reason to prioritise crawl budget optimisation.

An online retailer with extensive filtering options faces a different technical challenge. Its catalogue can generate many URL combinations from product attributes, sorting preferences and search parameters.

Google’s guidance on crawling faceted navigation URLs addresses these situations directly.

Restricting unnecessary URLs may reduce wasted crawler requests. It does not automatically redirect all available crawling resources towards other pages.

Robots.txt Versus Noindex

Use robots.txt when your objective is to restrict crawling. Use a noindex directive when your objective is to prevent an otherwise accessible page from appearing in search results.

For HTML pages, a noindex directive can appear within the page’s head section:

<meta name='robots' content='noindex'>

For resources such as PDFs, an HTTP response header can provide the instruction:

X-Robots-Tag: noindex

Google must be able to access the relevant resource to detect these instructions. Blocking the same URL through robots.txt can prevent Google from reading its noindex directive.

Refer to Google’s documentation on preventing search indexing before combining crawl restrictions with indexing controls.

Choosing the Correct URL Control

Business Objective Recommended Approach
Reduce crawling of unnecessary URL variations Robots.txt
Exclude an accessible page from search results Noindex directive
Protect confidential customer information Authentication and access controls
Consolidate equivalent URL variations Appropriate canonical signals
Remove permanently deleted content Return a suitable 404 or 410 response
Support discovery of important pages Internal links and XML sitemaps

Six brass key cards from a robots.txt guide matching business goals to the right URL control

Start with the business objective before selecting a technical instruction. Applying several controls to the same URL without understanding their interaction can produce conflicting outcomes.

Robots.txt SEO Benefits and Common Errors

A well-maintained robots.txt file supports technical SEO by defining which website sections crawlers can access. Its value comes from appropriate crawl management and avoiding unintended restrictions.

How Robots.txt Supports SEO Performance

We assess crawl restrictions in relation to the pages that contribute to a business’s search visibility and customer acquisition.

For a Singapore tuition centre, those pages may include subject-specific programmes and branch locations. For an industrial supplier, product specifications and category pages may deserve particular attention.

An unintended restriction affecting these sections should receive greater priority than an intentional exclusion affecting a sorting parameter.

Our technical SEO audit checklist explains how crawlability fits into a wider assessment of indexing, rendering and website performance.

Robots.txt should form part of that assessment alongside other technical signals.

Common Robots.txt Mistakes and Their Fixes

Common Mistake Potential Impact Recommended Fix
Leaving Disallow: / on a live website Prevents applicable crawlers from accessing website content Remove unintended restrictions
Blocking pages containing noindex instructions Prevents crawlers from detecting noindex Permit crawling so the instruction can be processed
Blocking CSS or JavaScript required for rendering Makes important page content harder for crawlers to interpret Permit access to necessary resources
Using broad wildcard patterns Restricts unintended URL groups Narrow the pattern and test representative URLs
Declaring an incorrect sitemap address Interferes with sitemap discovery or retrieval Correct the URL and verify accessibility
Treating robots.txt as a privacy control Leaves sensitive content potentially accessible Implement authentication and access restrictions

Six hotel warning cards from a robots.txt guide, each showing a common mistake and its fix

Each proposed fix should identify the affected URLs and explain their intended crawl status.

A general instruction to ‘fix robots.txt’ provides too little information for a developer to implement and validate safely.

Testing Robots.txt Changes Before Deployment

Create a test list covering representative URLs from important website sections. Include pages you intend to permit and pages you intend to restrict.

A simple testing framework might look like this:

Test URL Expected Crawl Status
/ Allowed
/services/seo/ Allowed
/products/category-a/ Allowed
/internal-search/?q=product Blocked
/assets/main.css Allowed
/sitemap.xml Allowed

These examples represent a hypothetical configuration. Build your own test list around the directories and page templates your business uses.

Use a suitable parser to compare the expected and actual results before publishing the changes.

Checking Robots.txt in Google Search Console

The robots.txt report in Google Search Console displays information about the files Google has retrieved, including reported fetch and syntax issues.

To investigate an individual page:

  1. Open the URL Inspection tool.
  2. Enter the affected page URL.
  3. Run a live test.
  4. Review its crawl permission and page fetch status.
  5. Correct unintended restrictions and repeat the inspection when Google has processed the updated rules.

Our guide to Google Search Console setup and reporting explains how these findings connect with wider search performance monitoring.

We recommend recording the affected page, the blocking rule and the completed fix. This gives marketing and development teams a shared record of what changed.

Recovering From an Accidental Crawl Block

Remove the unintended restriction and confirm that the updated file is publicly accessible. Search Console also allows you to request a recrawl of robots.txt after an important correction.

Google generally caches robots.txt for up to 24 hours, although fetch failures and other conditions can extend that period.

Monitor affected URLs through URL Inspection and the Page indexing report. Search visibility may take longer to recover because updated crawl permissions still need to be followed by further page processing.

Robots.txt Guide to Best Practices for Websites

The best robots.txt configuration is one your team can explain, test and maintain. Every restriction should serve an identifiable purpose connected to your website’s architecture.

Keep Rules Short and Specific

Avoid maintaining a long collection of individual URL restrictions when a carefully defined directory rule can achieve the same objective.

Google processes up to 500 KiB of a robots.txt file and ignores content beyond that limit. Large files should be reviewed for unnecessary repetition and opportunities to consolidate compatible instructions.

Use comments to document the purpose of important restrictions:

# Restrict unnecessary internal search URLs
User-agent: *
Disallow: /internal-search/

Comments help developers and marketers understand previous configuration decisions.

Allow Access to Essential Website Resources

CSS and JavaScript can help Google render the visible content and structure of web pages.

Avoid restricting resource directories containing files required to display navigation, product information or other important page elements.

After major template updates, check that Google can still retrieve the resources it needs. A browser displaying the website correctly does not establish that Googlebot has the same level of access.

Adapt Rules to Your Website Type

Different websites generate different crawl management requirements.

Website Type Crawl Management Priority
Corporate and professional services Keep service pages and location information accessible
E-commerce Manage unnecessary filter and sorting combinations
Educational websites Maintain access to public course and programme information
Publishers Keep articles and relevant category pages crawlable
Regional and multilingual websites Check rules across language directories and hostnames

Singapore businesses expanding into Malaysia, Indonesia or other regional markets should review crawl restrictions across their international website versions.

A rule written for an earlier site structure may become inappropriate after new country directories or storefronts are introduced.

Protect Staging and Development Websites

Development environments frequently contain unfinished content, test products or copies of production pages.

Restrict access through authentication or equivalent server controls if these environments should remain private. A robots.txt restriction alone cannot prevent unauthorised visitors or non-compliant crawlers from accessing them.

Before launching a redesigned website, confirm that production crawl permissions are correct. Do not carry development restrictions into the live environment.

Make Robots.txt Part of Website Governance

Review the file whenever your business changes its website architecture or hosting configuration.

We recommend including the following checks in your technical maintenance process:

  • Review crawl rules before website migrations and redesigns.
  • Confirm that newly introduced directories remain accessible where intended.
  • Check sitemap declarations after changes to website architecture.
  • Assign responsibility for approving and documenting rule changes.
  • Retain previous configurations to support troubleshooting.
  • Monitor important pages after deployment.

Treat robots.txt as a shared responsibility between marketing and development. The marketing team can identify commercially important pages, while developers can determine how the proposed rules interact with website infrastructure.

Conclusion

Robots.txt provides a practical way to manage crawler access, particularly for websites containing extensive URL inventories. Its effectiveness depends on selecting appropriate restrictions and understanding how those instructions interact with indexing controls.

Keep important service pages, product categories and resources accessible. Use noindex for pages that should remain outside search results, and protect confidential content through proper access controls.

At MediaOne, our approach to technical SEO starts with identifying the pages that support business objectives and checking their accessibility against actual website data.

Apply the same principle to your robots.txt file. Give every rule a clear purpose, test changes against representative URLs and review the configuration whenever your website evolves.

Frequently Asked Questions

Does every website need a robots.txt file?

No. A robots.txt file is optional, and Google generally assumes crawling is unrestricted if the file returns a 404 response. Websites with unnecessary URL variations or utility directories may benefit from specific crawl restrictions. Smaller websites with straightforward structures may require only minimal configuration and a sitemap declaration.

Can robots.txt remove a page from Google search results?

Robots.txt cannot reliably remove a web page from Google Search. A blocked URL may still appear if Google discovers it through links or other sources. To prevent an accessible page from appearing in search results, implement a noindex directive and permit Google to crawl the page so it can detect the instruction.

Where should the robots.txt file be placed?

Place robots.txt at the root of the relevant website hostname, such as https://www.example.com/robots.txt. Search engines do not use files placed in ordinary subdirectories as independent robots.txt configurations. Separate hostnames, protocols or non-standard ports may require their own files, depending on your website’s infrastructure and how it serves content.

Does crawl-delay work with Google?

No. Google does not support the crawl-delay directive in robots.txt. Bing supports it, although crawler behaviour varies across platforms. If Googlebot requests are creating server performance problems, investigate server logs, response times and hosting capacity. Google’s former Search Console crawl rate limiter was retired on 8 January 2024.

How do I check if robots.txt is blocking important pages?

Review the live robots.txt file for unintended restrictions, then test individual URLs using Google Search Console’s URL Inspection tool. Examine crawl permissions and page fetch results. If you identify an accidental block, correct the relevant rule, verify the published file and monitor the affected pages as Google processes the changes.

Can robots.txt improve my Google rankings?

Robots.txt does not provide a direct ranking boost. Appropriate rules can support technical SEO by reducing unnecessary crawler requests and preventing accidental restrictions on important content. Search performance also depends on content relevance, indexing eligibility and other ranking systems. Evaluate crawl management as part of your wider website optimisation programme.