Filters that combine, calendars that page forward forever, tracking codes in links: each one can hand a crawler a new URL every time it follows a link. A spider trap (or crawler trap) is the name for such a part of a website. The crawler keeps finding addresses it hasn't seen before, but behind them is the same content in a different order, or nothing useful at all. Visitors rarely notice, because to a person the feature works fine.
Most spider traps are accidents. (In bot security the same name is used for a deliberate trap that catches bad scrapers. This article is about the accidental kind that wastes a search engine's time.)
What a spider trap costs you
Google explains the problem in its guide to faceted navigation: a crawler can't tell whether a new-looking URL is useful until it has fetched it. So it typically crawls a very large number of trap URLs before its systems decide they're worthless. Crawling spent there is crawling not spent on your new and updated pages, and every request uses your server's resources. Google Crawling docs
How much that hurts depends on the size of the site. Google's crawl budget guide is written mainly for sites with more than a million unique pages that change about weekly, or more than 10,000 pages that change daily. On a small site, a trap mostly shows up as server load and cluttered reports. It's still worth fixing.
A spider trap is a technical problem, not a spam violation. There's no penalty, only wasted crawling.
Where spider traps come from
Google's URL structure guidance lists the patterns that most often create far too many URLs: Google Search Central
| Cause | Example | Why the URLs multiply |
|---|---|---|
| Combinable filters (faceted navigation) | /shoes?color=red&size=9&brand=x |
Every filter combination is a new URL |
| Sort parameters | ?sort=price_asc |
Each sort order repeats the same list |
| Session IDs | ?sessionid=8f3a... |
Every visit creates new URLs for every page |
| Tracking parameters | ?ref=newsletter |
Each value creates another copy of the page |
| Endless calendars | /events/2041/03/ |
"Next month" links never stop |
| Broken relative links | /about/about/about/ |
A parent-relative link on the wrong page keeps adding folders |
Most of these live in the query string. Internal site search is another source, since every word someone types creates a new results URL. The relative-link loop needs a second mistake to become endless: the server answers made-up paths with a normal page instead of a 404 error.
How to find a spider trap
- Read your server logs. Log file analysis shows exactly which URLs bots request. Group the requests by path and parameter. A trap shows up as thousands of hits on one template with changing parameters, far-future dates or repeating folders.
- Check Crawl Stats. The Crawl Stats report in Google Search Console breaks Google's requests down by response, file type and purpose, with example URLs. It's only available for root-level properties.
- Run your own crawl. A site crawler set to follow every link will get stuck in the same places. Watch for a URL count that grows far beyond your real number of pages, or URLs that keep getting longer.
- Look at the indexing reports. Thousands of parameter URLs under "Duplicate" or "Discovered – currently not indexed" often point to the same problem.
How to close the trap
For filters you don't need in search results, Google recommends one of two methods, which work better in the long run than the alternatives:
Block the filter URLs in robots.txt. Leave the individual product pages and one unfiltered listing page crawlable. Google's example:
user-agent: Googlebot disallow: /*?*products= disallow: /*?*color= disallow: /*?*size= allow: /*?products=all$Put filters in the URL fragment (after
#). Google generally ignores fragments when crawling and indexing.
A canonical tag pointing to the unfiltered page may reduce crawling of the variants over time. rel="nofollow" on filter links can help too, but only if every link to that URL carries it.
If some filtered pages should be indexed, keep their URLs tidy: use & between parameters, keep filters in a fixed order with no duplicates, and return a 404 for combinations with no results or no sense.
For the other causes:
- Calendars: add
rel="nofollow"to links to future dates, or block the calendar in robots.txt. - Session IDs: keep them out of URLs and use cookies instead.
- Relative links: use root-relative links (
/about/) and return a 404 for paths that don't exist. - Tracking and sort parameters: keep them off internal links, or block them in robots.txt.
What won't help
noindex. Google still has to fetch a page to see the tag, so it saves no crawling. Google Crawling docs- The URL Parameters tool. Search Console retired it in 2022. Google now decides how to handle parameters on its own and points to robots.txt if you need more control.