The robots file has been changed, but the crawling log has not changed, first check whether it takes effect or check the writing method.
If the robots file has changed but the crawling log is not changed, first check whether it is effective or check the format? First check whether it is effective, then check the format. If the format is wrong, it will always be wrong, but if the effectiveness is not in place, even if the format is changed three times, you will not see any changes. The most common pitfall is to take 'I changed it' as 'the crawler read it'.
First confirm whether the changes have been read.
robots configuration is changed in the background, after landing, it needs to pass two stages: whether the file itself outputs new content, and whether the crawler uses the new cache to read it again.
The first one can be verified by itself: directly request the robots.txt under the root path of the site, and see if the returned version is the one just written. The most common unexpected event here is that pseudo-static or cache redirects the request to old content, or changes may only exist in the configuration and have not yet been generated into actual files.
The second one needs to wait. It is common for the crawler to read new instructions with a delay, and there is no change in the daily logs after the change; it is more effective to wait a few days to see the trend. Judging whether it takes effect should look at the trend rather than a single log entry, and the differences in the single crawl record are more from the task rhythm.
The three most common mistakes in writing style
- The scope of action is written too small or too large. The rules for grouping by user-agent only take effect on the crawlers that match, and when both the general group and the named group exist, which group to read is determined by the crawler's own implementation. Changing one does not mean it takes effect globally.
- The path prefix is not aligned. The instruction matches the prefix, whether the directory ends with a slash, and whether the case is consistent with the real address, any deviation will cause the rule to fail or expand.
- Two rules conflict with each other. When the same prefix has both allowance and prohibition, the result may not be as expected. Deleting the conflicting entries and rewriting them is more reliable than adding one to cover.
Also check if the site map address is still hanging in the file. Many people, when changing the shielding rules, also remove the entry.
Crawl control and anti-crawling are not the same thing.
There is a third possibility if the log does not change: what you want to solve is not a crawling problem.
robots control whether to take it and which paths can be taken, it cannot prevent the distribution of content by sites that have already obtained it. The protection at the content level takes another approach: interference codes are inserted into the page in invisible fragments to ordinary readers and harmful to copyists, preventing collection is aimed at taking actions rather than crawling actions. The verification methods of the two levels are also different - the former looks at the crawling log and the collection area, and the latter looks at the source code of the page and the actual presentation on external sites.
When deploying across multiple sites, the robots configuration of each site takes effect independently, changing the main site will not affect the sub-sites, and verification needs to be done for each site.
How long should the verification take effect?
Leave a few days to two weeks before looking at the crawling trend to get closer to the actual situation, especially in large file quantity or multi-site scenarios. Maintain a stable configuration in the middle, and changing while watching will not match the cause and effect.
Common questions
Can you use the crawling records to verify immediately after the modification?Only the file output can be verified, whether the crawler has been reread cannot be verified, and the trend needs to wait.
The logs are full of crawler names, but it is not clear who they are?First group and count by user-agent, then look at the corresponding rule block for each group, not just the total amount.
If robots are banned, will it still be crawled?Banning is a request rather than a mandatory measure, historical addresses and entries referenced by other sources may still appear.