Where is the Robots file located, what can it control, and what can it not control?

📅 October 9, 2026 Eye 10

Where should the robots.txt file be placed on a website, what can it control, and what can it not control? The location is the root directory of the site, there is no other choice; the boundary of its ability is 'control crawling', not 'control indexing'. Many sites have problems exactly on these two points: the file is placed in the wrong level, causing the rules to be completely ineffective, or the content that should not be made public is given to it to hide. Understanding what it controls and what it does not control can help determine whether the problem is with crawling or content during collection and troubleshooting.

Why must the location be in the root directory only

The file lookup method is fixed: when the crawler accesses the site, it first takes this one according to the root path and will not go to the secondary directory or sub-site directory. Placed in /static, /admin, or some sub-directory, it is equal to not taking effect.

This is more likely to go wrong when deploying multiple sites: the same program is hung on multiple domains, and each domain must have this file under its own root directory, and the rules cannot be borrowed from each other. Writing restrictions for the main station does not mean that the branch stations also have the same restrictions.

It can manage two things

The first is path visibility: declares which paths are allowed to be crawled and which are not, the rules apply to all files under the path. The second is the crawling rhythm, which tells the processor how long to wait between requests through an independent request header field, used to control the access pressure on the server.

AnQiCMS has made this item a background configurable SEO setting, which takes effect directly after modification, without the need to manually change the files on the server - this is very useful for websites that frequently adjust rules, as it reduces the cost of making mistakes.

The three things it cannot control.

The first is a page that has already been publicly linked. Restricting crawling only prevents it from taking content, but if the page has external links pointing to it, it may still appear in the results. Moreover, since no text is retrieved, the abstract displayed may be even more uncontrollable. To truly control whether it is included, you need to use meta tags or response headers within the page, which belongs to another path.

The second is access permissions. It is not an authentication mechanism, anyone who opens this file can read the paths written inside, and listing the background directory, test directory, etc. is like giving out a map to outsiders.

The old address that has already been distributed. After the upgrade, the old link direction needs to be handled by 301 redirect, and relying on limiting crawling will only allow the old and new addresses to coexist for a longer time.

How to write the line pointing to the sitemap

The location of the sitemap can be declared in the file, written as a separate line to provide the complete address of the sitemap file. Pay attention to three things: this address must be accessible directly; it points to the currently effective version, do not keep the old domain after the upgrade; multi-site each declare their own version.

The common mistake is to block the crawling of the site map file directory in one piece, resulting in the declaration line pointing to an inaccessible address, creating contradictions on both sides, making the site map virtually non-existent. Whether the declaration overrides the restriction depends on the path matching, and only two points need to be checked when inspecting: the site map address itself is accessible, and it is not under any restriction path.

Drafts and content to be published should not be hidden by it.

Drafts, pending publications, and items in the recycling bin should not be visible to the public. Writing their paths into restriction rules is the most convenient approach, but not safe: once links are sent out, they may leave traces elsewhere, and crawl restrictions will not take the page offline.

A more stable approach is to control from the status: drafts and pending publications do not generate accessible addresses to the public, previews go through dedicated links with preview parameters, and the default crawl side does not enter the list; sitemap and link push only output formal documents. In this way, active push and new address submission will not push out unfinished content, and it is not necessary to pile rules in this file.

Common questions

Why can't I access this file in the root directory? It's mostly because the pseudo-static rules have eaten up the request, or the site is deployed in a sub-path. First, access directly to confirm that the return status code is successful and not redirected or rewritten to the homepage.

Will limiting crawling affect the weight? It doesn't directly affect ranking, it only determines whether content can be retrieved. To control display and indexing, go the route of meta tags or response headers within the page.

How often should you check? You should review it after changing path rules, adding sub-sites, and launching new modules, and check once a quarter normally.

Related articles

What three warnings can the security fixes in the PbootCMS version update announcement provide for website building?

PbootCMS official website update log shows that the fixes in V3.2.25 (build 2026-09-08) are focused on three areas: limiting the rewrite of background fields to prevent credentials from being overwritten, requiring authenticated POST requests with form validation for the account management interface, and refusing identity verification for unverified proxy headers. The corresponding reminders on the website building side are: background write interfaces must authenticate and verify the request method, file and directory access cannot rely solely on agreed paths, and external crawling must have frequency and timeout constraints.

2026-10-09

Should the selection be based on the number of installations, and how should the CMS market share data be read?

The number of installations and market share can illustrate the attention to ecosystem supply and attack focus, but cannot explain how fast your site will run or how much maintenance will cost. According to the statistics口径 of W3Techs on October 8, 2026, WordPress is used by 58.6% of known content management system websites; these numbers are proxy indicators. When selecting, return to the three measurable indicators: resident memory usage, page loading and concurrent carrying capacity, and suitability for application scenarios.

2026-10-09

How to read the Drupal core SQL injection announcement, what steps should be taken for patch follow-up on enterprise sites.

Read the Drupal core security announcement to focus on five fields: number, severity, vulnerability type, affected version range, and fixed version. For enterprise sites, follow the patch in four steps: confirm if you are in the affected range, make a rollbackable backup, upgrade to the fixed version of the corresponding branch, and review the login and query entry. SQL injection is a high-risk issue, making a backup before upgrading can avoid secondary failures caused by upgrade failures.

2026-10-09

Can a low-cost server run an enterprise-level CMS, see these three indicators.

Can a low-end server run an enterprise-level CMS? It depends on three self-test indicators: resident memory usage, page loading and single-machine carrying capacity, and resource curve under concurrency. According to the official statement, the memory usage of the GoLang technology stack is about 80% lower than that of PHP CMS, and the page loading speed is significantly improved compared to traditional PHP CMS, with a single machine capable of carrying about 5 million PV. This article provides methods for level judgment, self-test steps, and the impact of deployment methods on resources.

2026-10-09

What is being fixed in the WordPress maintenance version, and how often should it be updated?

Maintenance versions fix the combination of defects and security issues in the released versions. The follow-up rhythm depends on whether this version contains security fixes. Taking WordPress's public release records as an example, this article explains the differences between maintenance versions and major versions, which three items to focus on in the announcements, how often it is appropriate to follow up, and provides a checklist for pre-and-post-upgrade checks for your own site.

2026-10-09

How should static site generators and dynamic CMS be分工?What items should a corporate website look at?

The difference between the two routes lies in when the content becomes a page: the generator calculates all pages at once when published, while the dynamic system calculates them in real-time when accessed. The true focus of the corporate website should be on four aspects - whether the content structure can be customized, whether non-developers can make changes themselves, whether the update frequency can sustain, and whether the address and jump rules can be maintained on the backend. This article provides a judgment table and common division of labor for the mixed use of both.

2026-10-09

Which type of source does AI search prefer to cite, and what three things can be done on-site to cooperate.

The research presented publicly indicates that the references in AI answers are mostly from brand-owned or brand-near sources, rather than randomly selected third-party pages. The three things that can be coordinated within the site are to unify the口径 and anchor text, write paragraphs that can be extracted separately as answers, and ensure that the path to the content list is accessible. This article provides methods and checkpoints based on these three things.

2026-10-09

How to measure GEO effect: three indicators of citation rate, visibility, and AI traffic.

The effect of optimizing the generative engine should be measured by three indicators: the citation rate looks at whether the source is included in the answer, the visibility looks at the proportion mentioned in the fixed question set, and the AI traffic looks at the behavior quality after actually entering the site. Only looking at the entry traffic will underestimate the effect, because a significant proportion of questions do not click on any page when answered. This article provides methods for collecting the three indicators, how to build the sampling question set, and a weekly record table.

2026-10-09