Robots.txt:
configure and test
Understand crawling rules, how they differ from noindex, and how to test real URLs. Includes file examples, links to tools and clear acceptance criteria.

Test the URLs.
Record the results.
One file can affect many pages. Prepare a representative set of URLs, compare results before and after the change, and check which version the search crawlers received.
What to decide before writing the first robots.txt line
Robots.txt is a publicly accessible text file containing crawling rules. It helps control which URLs a search crawler requests. Start by listing your pages: which should attract visitors from search, which serve internal functions and which must never be accessible to unauthorised people.
These objectives require different solutions. A product catalogue should usually remain crawlable. A public thank-you page can be excluded from the index with noindex. An account area needs server-side access checks. Trying to solve all three with Disallow creates a false sense that the site is configured correctly.
| Task | Primary tool | What to check |
|---|---|---|
| Restrict crawling of a group of URLs | Allow and Disallow in robots.txt | The rule matches the intended URLs without affecting useful pages. |
| Keep a public page out of search | A robots meta tag with noindex or an X-Robots-Tag HTTP header | The crawler can fetch the page and read the instruction. |
| Protect documents and data | Authentication and permission checks | An unauthorised visitor cannot retrieve the content through a direct link. |
| Consolidate duplicate URLs | Redirects, canonical and a consistent link structure | A preferred URL is chosen, with no conflicting signals. |
Google warns that blocking crawling does not guarantee that the URL itself will disappear from search results. See the introduction to robots.txt. Below, we focus on configuring crawling: one part of technical SEO, rather than a standalone way to gain rankings.
Where to find robots.txt and how to open it
For the website https://example.com/ open https://example.com/robots.txt. Replace example.com with your domain. You should see plain-text rules. If an error page, login form or your site’s visual layout appears, first fix how the file is served.
Use the filename robots.txt in lowercase. Do not upload it to an images folder or save it as robots.txt.txt. Subdomains, protocols and non-standard ports matter: rules at one address do not automatically apply to every version of the site. The general creation and placement process is covered in Google’s instructions.
- Open the homepage and copy its final address after redirects.
- Append
/robots.txtto the site root and open it in a private window. - Save the current version as a separate text file with a date.
- Record what generates the response: server, CMS, SEO plugin or caching system.
- Check subdomains separately if they host independent sites.
WordPress may generate it dynamically. You do not need a second source of rules just to have a physical file. What matters is the actual text a visitor receives at the public URL.
List the URLs before changing the rules
Checking only the homepage will not reveal whether a block affects filters, images or part of the catalogue. Build a small test set that represents your site’s actual structure. Define the expected result for each URL in advance, then compare it with the observed result after the change.
| URL type | Example | Expected result |
|---|---|---|
| Homepage and category | /, /catalog/chairs/ | Crawling allowed. |
| Product page | /products/chair-a/ | Crawling allowed; no pattern accidentally blocks the product. |
| Filter landing page | /catalog/chairs/wood/ | Crawling allowed if this is a useful SEO page. |
| Internal search results | /search/?q=chair | Agree on the approach separately: crawl restriction or noindex. |
| Page resources | One CSS file, one JavaScript file and one image | Resources needed to render the page are accessible to the crawler. |
| Admin area | /admin/ | Crawling restricted; authentication separately protects access. |
The examples in the table are illustrative. Do not create these paths just for testing or copy blocks before defining what your existing pages do. Add URLs with parameters, similar folder names and different capitalisation: unexpected matches often appear at the boundaries of a pattern.
How to read User-agent, Disallow, Allow and Sitemap
User-agent identifies the crawler or group of crawlers the rules apply to. Disallow blocks crawling of a matching path; Allow allows it. Sitemap gives the full XML sitemap URL. Comments start with a hash. Write each directive on a separate line.
User-agent: *
Disallow: /draft-catalog/
Allow: /draft-catalog/public-guide/
Sitemap: https://example.com/sitemap.xml
The example blocks a drafts directory but allows its nested public reference section. Robots.txt does not protect the drafts from people: non-public material requires access controls.
Google selects the most specific matching User-agent group; the general asterisk group does not automatically supplement a dedicated Googlebot group. When paths conflict, the rule’s specificity matters, not its position in the file. The symbol * matches any sequence of characters; $ marks the end of a URL. Paths are case-sensitive. Exact conditions and exceptions are set out in Google’s specification.
For each line, describe in your own words which real URL it should affect. If the explanation is “just in case”, return to your objectives. A short, clear file is easier to maintain than a collection of borrowed rules.
Test similar paths, parameters and exceptions
Suppose you have an internal section /search/ and a useful article /search-marketing/. A block using the short prefix /search may affect both. Test not only the URL you want to block, but also the similar page that should remain accessible.
| Rule | URLs to test | What to establish |
|---|---|---|
Disallow: /search/ | /search/?q=test and /search-marketing/ | The internal section is blocked; the useful article remains accessible. |
Disallow: /offer$ | /offer, /offer/, /offer?ref=a | An end-of-URL condition does not imply a block on every variation. |
| General block with a nested Allow exception | The exception URL and a neighbouring URL | Only the intended part is accessible, not the whole internal section. |
| Dedicated crawler group | The same URLs for Googlebot and Yandex | General restrictions were not lost when the groups were split. |
Do not apply a blanket rule to every URL containing a question mark before understanding the parameters. They may control language, catalogue pagination, products or useful filters. Compare URL pairs with and without each parameter for content, accessibility and canonical URL.
Getting started with robots.txt in WordPress
WordPress can serve a virtual robots.txt. The source code of do_robots() blocks crawling of the admin area and allows admin-ajax.php. Plugins and filters can modify the final response, so check the public URL after saving your settings.
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://example.com/sitemap_index.xml
This is a starting point for review, not a universal WordPress configuration. Replace the sitemap URL with one that actually exists: some sites use sitemap_index.xml, others wp-sitemap.xml. Open the sitemap and check its child files. WordPress installations in a subdirectory also require a path check.
Do not block the entire wp-content folder: it may contain images and assets required for rendering. Assess archives, tags and author pages by their content and purpose. Coordinate individual page settings with your SEO plugin instead of trying to express the entire indexing strategy through path prefixes.
Identify what generates robots.txt, save a backup, apply the agreed rules and show the final public response. Attach the test-URL results to the report. If caching is used, also check the response after refreshing the cache.
When to use Clean-param and what must not be treated as insignificant
Clean-param helps Yandex handle parameters that do not change content. Suppose an internal campaign_id parameter only tracks an ad click while the product page stays the same. After verifying that condition, you can prepare a rule for the relevant part of the site:
Clean-param: campaign_id /products/
Do not declare product, language or catalogue-page parameters insignificant simply because they generate many URLs. First compare the page with and without the parameter: heading, main text, product list, price and available language version.
According to Yandex’s documentation, some analytics tags may be removed automatically if the algorithms consider them insignificant. There is no need to add rules for those tags merely to have an extra line. Clean-param does not replace a site-structure review and is not a Google directive.
Record the decision in a table: parameter name, example URL, whether it changes content, chosen treatment and owner. When a new analytics system is added, the team can see what has already been checked and what needs a separate decision.
Why Disallow and noindex are not interchangeable
To exclude a publicly accessible HTML page from Google Search, you can place this meta tag in its head:
<meta name="robots" content="noindex">
The crawler must fetch the page to read this instruction. Blocking it in robots.txt at the same time may prevent that. For non-HTML files such as PDFs, use an X-Robots-Tag HTTP header. The methods and limitations are explained in Google’s noindex guide.
For example, you decide to keep a submission-confirmation page out of search. Specify its URL, the presence of noindex in the response and the absence of any crawl block that would hide it. Then check the result with the search engine’s tool. An admin-settings screenshot is not enough: a template or cache may serve something different.
If the page contains personal data from the enquiry, search settings alone are not enough. It must enforce access permissions. Robots.txt is public: listing a path in it does not make that path secret.
How to test robots.txt in Yandex Webmaster
Open Yandex Webmaster and go to Tools → Robots.txt analysis. Select your site or enter the address to analyse. The exact procedure for added and unverified sites is described in the tool’s help page.
- Load the published file and make sure its text matches the latest change.
- Review errors and crawling rules. A syntax error differs from a valid rule that produces an unwanted result.
- Add your test URLs to the URL list under Check if URLs are allowed.
- Run the check and compare every result with your expectation.
- If you edited the text inside the tool, copy the tested version to your site: editing the analyser’s field does not update the site itself.
For the developer, record the URL, desired result, actual result and the rule responsible. Attach the test date and the published file’s text. This turns “the crawler cannot see the catalogue” into a reproducible issue.
Every URL in the test set returns the expected result. A lack of syntax errors alone does not mean the file meets the site’s objectives.
Checking the file and an individual page in Search Console
In Google Search Console you handle two different tasks: checking whether robots.txt was fetched and diagnosing an individual URL. Start with the robots.txt report: it shows the fetched version, fetch date and processing problems. You can request a file recrawl for a critical fix.
- Choose the property matching the domain and protocol you are checking.
- Check the robots.txt status and open the latest fetched version.
- Compare it with the file currently on the site. An older date is a reason to distinguish the search engine’s cached copy from the change already published.
- Enter an important URL in the URL Inspection tool.
- Run Test Live URL to check the currently published page.
- Review whether crawling is allowed, whether the page was fetched and whether indexing is allowed.
A successful live test does not prove that the page is indexed or will rank. Stored indexing data and a live URL test refer to different points in time. This distinction is explained in the URL Inspection tool’s help.
Track two separate milestones: “the site serves the corrected response” and “the search engine has processed the change”. This prevents repeated edits to a correct file just because the report updates later.
What to do when the result differs from your expectation
| Symptom | What to check | What counts as fixed |
|---|---|---|
| The entire site is blocked | General Disallow rules, dedicated crawler groups and the version carried over from staging. | Key public URLs are allowed and actually load. |
| The change is not visible | Physical and virtual files, the active plugin and server cache. | The public response matches the agreed version. |
| Homepage allowed, product blocked | Catalogue prefixes, parameters, and rules using * and $. | The test set of categories and product pages passes. |
| Google and Yandex return different results | User-agent groups, supported directives and the file’s fetch date. | The difference is explained by configuration or corrected if unintended. |
| The file is accessible, but the page is not indexed | Noindex, canonical, server response, content and internal links. | A specific cause is identified; robots.txt is not changed without a reason. |
| A server error appears instead of the rules | Hosting availability, the file-serving route and request limits. | Search engines can fetch the file reliably. |
A robots.txt 404 and a 5xx response are not the same problem: Google handles them differently. For server failures, use the official specification and the fetch report instead of assuming “no file means the site is definitely blocked”.
If a block appeared alongside a traffic drop, preserve the change timeline and investigate other causes too. Do not promise recovery by a fixed date: crawl access, revisits, indexing and rankings are separate stages. For a broader diagnosis, also use our guide to SEO mistakes.
How to hand over a change and accept the result
Agree on a small change with a clear objective. Do not change crawling rules, section URLs and indexing settings at once without a shared plan: unexpected results would be hard to trace. Save the old version and decide in advance how to restore it.
“Restrict crawling of /search/?q=test. Keep /search-marketing/, /catalog/ and product pages accessible. Attach the original and new robots.txt versions, test results for these URLs for Yandex and Google, and a rollback method. Separately confirm that CSS, JavaScript and images remain accessible.”
Check the file immediately after release, then review the reports after search crawlers next fetch it. Repeat the checks when the CMS, SEO plugin, domain, catalogue structure or cache system changes. The overall acceptance process is covered in “How to accept a website from a developer”.
Robots.txt configuration checklist
- Search pages, internal sections and data requiring authentication are identified.
- The file’s source is known and the original version is saved.
- The public URL returns the agreed rules.
- Dedicated crawler groups and similar paths have been tested.
- Important pages and rendering resources are not blocked by mistake.
- The XML sitemap URL exists and belongs to the current site.
- Parameters have been assessed for their effect on content.
- A crawl block does not hide noindex from the crawler.
- Expected and actual results are recorded for the test set.
- A change owner and a method for restoring the previous version are defined.
This checklist assesses crawling configuration. It does not replace an audit of content, structure, duplicates or user journeys. If the task is broader than one file, start with a website SEO plan and an agreed list of technical tasks.
Frequently asked questions about robots.txt
Does a small site need robots.txt?
Site size alone does not determine whether restrictions are needed. The file is useful when you have clear crawling rules and a sitemap URL. Do not complicate it with restrictions unrelated to your project.
Why is a blocked page’s URL still visible in Google?
Blocking crawling does not guarantee removal of a URL from search. Choose the appropriate exclusion method, check that noindex can be read, and inspect the page’s status in Search Console.
Can I copy the file from another site?
Another site’s file can provide a list of things to consider. Do not publish it unchanged without checking your own URLs: paths, parameters, sitemaps and useful sections differ.
Do I need separate Googlebot and Yandex groups?
Only when there is a justified difference in the rules. After splitting groups, check which restrictions each crawler receives. Do not assume that a dedicated group automatically inherits the general one.
Is a green analyser result enough?
No. You need rules that fit your actual pages, confirmation that the file is fetched and checks for other indexing obstacles. A syntactically valid block can still be wrong for the business.
When will the result appear in search?
There is no single timeframe. First confirm the fix is published, then that the crawler has fetched the new version and processed the pages. Changing robots.txt alone does not guarantee indexing or higher rankings.
CHECK YOUR SITE’S
TECHNICAL READINESS FOR SEO
We review page accessibility, crawling rules, duplicates and sitemaps. We prepare tasks for your developer and verify the published fixes.