Sub topic 8
Scoping a crawl: include and exclude rules, limits, user-agent and speed
This chapter assumes you have run a first crawl and can find the Internal tab. It covers the settings that decide which URLs the SEO Spider requests and how hard it hits your server. Scope first, then crawl. A focused crawl finishes sooner and is easier to read.
Include and exclude rules
Both rules live under Configuration and take regular expressions. The expression is matched against the whole URL, so it must match from the first character to the last. That is why the example below starts and ends with .*.
- Exclude stops matching URLs from being crawled. Excluded URLs do not appear in the results.
- Include crawls only URLs that match. Everything else is skipped, so the start URL must match too.
This rule skips session-ID duplicates:
.*\?sessionid=.*Use the Test tab in the dialog to paste a URL and confirm whether a rule matches it. Changes apply to a new crawl, not to one already in progress.
Limits
Under Configuration > Spider > Limits you can cap the crawl. Useful settings include:
| Setting | Use it to |
|---|---|
| Limit Crawl Total | Stop after a set number of URLs. The free version stops at 500 regardless. |
| Limit Crawl Depth | Stay within a set number of clicks from the start URL. |
| Limit Max Folder Depth | Avoid deeply nested directories. |
| Limit Number of Query Strings | Contain faceted navigation and calendars. |
Start with a small limit on an unfamiliar site. Raise it once the sample looks clean.
Robots.txt and user-agent
Under Configuration > robots.txt > Settings, the default is to respect robots.txt. You can also ignore it, or ignore it but still report which URLs it blocks. Only ignore it on a site you own.
Under Configuration > User-Agent you choose the string sent with each request. Switch to a Googlebot preset to see what a search engine is served. Some servers treat bots differently, so a mismatch can explain pages that return errors only in your crawl.
Speed
Under Configuration > Speed you set the maximum threads and, optionally, a maximum number of URLs per second. More threads finish sooner but load your server more. Watch the response times in the crawl. If they climb, or you start seeing 429 or 5xx responses, lower the limit and run again.
Exercise
A crawl of your shop returns thousands of URLs ending in ?sort=price. You still want every product page crawled. Should you use Include or Exclude, and what regex would you use?
Show answer
Use Exclude, because you want to remove one pattern and keep everything else. A suitable regex is .*\?sort=price.*. Check it in the Test tab, then start a new crawl.