---
title: "Bulk lighthouse testing & --maxRoutes config"
description: "Run Lighthouse on your entire site with Unlighthouse. Limit pages with --maxRoutes, filter by URL pattern, and automate bulk audits."
canonical_url: "https://unlighthouse.dev/learn-lighthouse/bulk-lighthouse-testing"
last_updated: "2025-01-12"
---

> Index of every page on this site: [llms.txt](https://unlighthouse.dev/llms.txt)

## `--maxRoutes` CLI flag: default 200, override with one command

Use `--maxRoutes` to raise the per-scan page limit (default is 200):

```bash
npx unlighthouse --site https://example.com --max-routes 2000
```

The flag accepts any positive integer. Pass `-1` to disable the limit and scan every URL Unlighthouse discovers. This is the fix if your bulk scan is stopping at 200 pages.

## Run Lighthouse on every page, not just the homepage

Standard Lighthouse tools test one page at a time. But your site has hundreds, maybe thousands, of pages, and the [2024 Web Almanac](https://almanac.httparchive.org/en/2024/performance) added secondary page analysis because **homepage performance is not representative of the entire site**.

**Your homepage might score 100.** What about:

- Product pages with heavy images?
- Blog posts with embedded videos?
- Category pages with infinite scroll?
- User-generated content pages?

Each page type has different performance characteristics.

## The solution: Unlighthouse

Unlighthouse crawls your site and runs Lighthouse on every page automatically.

```bash
npx unlighthouse --site https://your-site.com
```

## How it works

1. **Crawl**: Discovers all pages from your sitemap and internal links
2. **Audit**: Runs Lighthouse on each page in parallel
3. **Report**: Interactive report sorted by worst scores

## Installation

No installation required. Use npx:

```bash
npx unlighthouse --site https://your-site.com
```

Or install globally:

```bash
npm install -g unlighthouse
unlighthouse --site https://your-site.com
```

## Configuration

Create `unlighthouse.config.ts`:

```ts
export default {
  site: 'https://your-site.com',
  scanner: {
    // Crawl settings
    maxRoutes: 200,
    samples: 1,
  },
  lighthouse: {
    // Lighthouse settings
    throttling: {
      cpuSlowdownMultiplier: 4,
    },
  },
}
```

## Common options

| Option       | Description              | Default        |
| ------------ | ------------------------ | -------------- |
| `--site`     | URL to scan              | Required       |
| `--urls`     | Specific URLs to test    | All discovered |
| `--samples`  | Runs per URL             | 1              |
| `--throttle` | Simulate slow connection | true           |

## Filtering pages

Test specific sections:

```bash
npx unlighthouse --site https://your-site.com --urls "/blog/**"

npx unlighthouse --site https://your-site.com --exclude "/admin/**"
```

## Reading results

The report shows:

- **Score distribution**: How many pages are good/needs improvement/poor
- **Worst pages**: Sorted by score, fix these first
- **Issue breakdown**: Common problems across your site

## Understanding lab vs field data

Google [uses field data (CrUX) for search ranking](https://developers.google.com/search/docs/appearance/core-web-vitals), not lab scores from Lighthouse.

| Aspect           | Lab Data (Lighthouse) | Field Data (CrUX)                                                            |
| ---------------- | --------------------- | ---------------------------------------------------------------------------- |
| Source           | Simulated tests       | Real user visits                                                             |
| Used for ranking | No                    | Yes                                                                          |
| Best for         | Debugging issues      | Measuring actual UX                                                          |
| Update frequency | Immediate             | [28-day rolling average](https://developer.chrome.com/docs/crux/methodology) |

Lab testing with Unlighthouse helps you **find and fix issues**. Monitor field data to verify improvements reached real users.

## Lighthouse scoring method

[Lighthouse performance scoring](https://developer.chrome.com/docs/lighthouse/performance/performance-scoring) weights metrics differently:

| Metric                                          | Weight |
| ----------------------------------------------- | ------ |
| [Total Blocking Time (TBT)](https://unlighthouse.dev/glossary/tbt)      | 30%    |
| [Largest Contentful Paint (LCP)](https://unlighthouse.dev/glossary/lcp) | 25%    |
| [Cumulative Layout Shift (CLS)](https://unlighthouse.dev/glossary/cls)  | 25%    |
| [First Contentful Paint (FCP)](https://unlighthouse.dev/glossary/fcp)   | 10%    |
| [Speed Index](https://unlighthouse.dev/glossary/speed-index)            | 10%    |

Scores are derived from [real website performance data on HTTP Archive](https://developer.chrome.com/docs/lighthouse/performance/performance-scoring):

- 0-49: Poor (red)
- 50-89: Needs Improvement (orange)
- 90-100: Good (green)

## Reducing score variability

Lighthouse scores vary between runs. Follow [Google's guidance](https://developers.google.com/web/tools/lighthouse/variability):

- **Run multiple times**: The median of 5 runs is twice as stable as 1 run
- **Use consistent hardware**: Don't run concurrent tests on the same machine
- **Isolate from third-parties**: External scripts add variance
- **Scale horizontally**: Run on multiple smaller instances rather than one large one

Unlighthouse defaults to running multiple samples and averaging for stable results.

## CI/CD integration

Run on every deploy to catch regressions:

```yaml
name: Lighthouse Audit
on: [push]

jobs:
  lighthouse:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run Unlighthouse
        run: npx unlighthouse-ci --site ${{ env.SITE_URL }}
```

Set performance budgets to fail builds when scores drop:

```ts
// unlighthouse.config.ts
const config2 = {
  site: 'https://your-site.com',
  ci: {
    budget: {
      performance: 80,
      accessibility: 90,
    },
  },
}
```

For CI/CD automation with performance budgets, see the [Lighthouse CI guide](https://unlighthouse.dev/learn-lighthouse/lighthouse-ci) or platform-specific guides for [GitHub Actions](https://unlighthouse.dev/learn-lighthouse/lighthouse-ci/github-actions) and [GitLab CI](https://unlighthouse.dev/learn-lighthouse/lighthouse-ci/gitlab-ci).

## Alternatives comparison

How Unlighthouse compares to other tools:

| Tool               | Bulk Testing    | Pricing    | Notes                                                                                             |
| ------------------ | --------------- | ---------- | ------------------------------------------------------------------------------------------------- |
| **Unlighthouse**   | Unlimited pages | Free (CLI) | Open source, self-hosted                                                                          |
| PageSpeed Insights | 1 page/request  | Free       | [25,000 requests/day API limit](https://developers.google.com/speed/docs/insights/v5/get-started) |
| DebugBear          | 10,000/mo       | $99/mo     | Managed service                                                                                   |
| Calibre            | 5 sites         | $150/mo    | Managed service                                                                                   |
| SpeedCurve         | Varies          | $20-500/mo | RUM + synthetic                                                                                   |

## Current web performance stats

Context for your scores from [HTTP Archive 2024](https://almanac.httparchive.org/en/2024/performance):

| Metric                  | Mobile Pass Rate | Desktop Pass Rate |
| ----------------------- | ---------------- | ----------------- |
| Core Web Vitals (all 3) | 48%              | 54%               |
| LCP                     | 59%              | 72%               |
| CLS                     | 79%              | 72%               |
| INP                     | 74%              | 97%               |

If you're beating these numbers, you're ahead of most of the web.

## Best practices

1. **Test representative pages**: Don't just test the homepage
2. **Run multiple samples**: Average results for stability
3. **Test on realistic hardware**: Use CPU throttling to simulate mobile
4. **Monitor trends**: One-time audits aren't enough
5. **Fix worst pages first**: Greatest impact for least effort
6. **Validate with field data**: Lab scores don't affect ranking

## Next steps

1. Run your first scan: `npx unlighthouse --site https://your-site.com`
2. Fix the worst pages first
3. [Set up CI/CD](https://unlighthouse.dev/learn-lighthouse/lighthouse-ci/github-actions) to catch regressions

## Sitemap

See the full [sitemap](https://unlighthouse.dev/sitemap.md) for all pages.
