Find every slow page on a website, fix it, and prove it: 28 seconds down to 2
A bakery home page took 28.2 seconds to show its main photo on a phone; two fixes later it took 2.1. Unlighthouse runs Google's Lighthouse test on every page of a site at once and puts the slow pages, missing titles and broken bits in one report. Turn that into a fix list a business will pay for, and a monthly check they'll keep paying for.
- Real before and after numbers: two fixes on a test site took its slowest page from 28 seconds to 2
- A prospecting routine: scan a list of local businesses' home pages gently, worst first, and pitch with their own numbers
- Node.js 22.18 or newer. Level 0 covers it: Install anything from GitHub
- Google Chrome installed (Unlighthouse borrows it)
- About 1GB of free disk space for the first run
- A website to scan. The rule for this whole lesson: scan your own sites and clients who've said yes as much as you like; for a business you haven't spoken to yet, scan its public pages only, at most 5, one at a time
Run your first scan
One command finds every page on a site and tests each one, instead of you pasting pages into PageSpeed one at a time.
Check your Node version first. Unlighthouse needs 22.18 or newer:
Terminalnode --versionOutputv26.7.0Make a folder for your scans, go into it, and point Unlighthouse at a site. Use your own site for this first run:
Terminalmkdir site-scans cd site-scans npx unlighthouse --site https://www.your-site.co.ukIf npm asks Ok to proceed?, type
yand press Enter. The first run downloads Unlighthouse and Lighthouse: allow a few minutes and just over 1GB of npm's cache (450MB of program files plus 600MB of downloaded packages). After that it starts in seconds.It finds the pages by reading the sitemap, or by following links when there isn't one, then tests each page. Here's the start and end of a run on this mission's sample website (more on that in Step 2):
Output[Unlighthouse] ℹ Using system Chrome located at: C:\Program Files\Google\Chrome\Application\chrome.exe. [Unlighthouse] ✔ Successfully connected to http://127.0.0.1:7136. (Status: 200). [Unlighthouse] WARN You seem to be missing a robots.txt. [Unlighthouse] ℹ Sitemap appears to be missing, falling back to crawler mode. Unlighthouse cli @ v0.19.1 ▸ Scanning: http://127.0.0.1:7136 ▸ Route Discovery: Crawler Report: http://127.0.0.1:7135/ ... [Unlighthouse] ✔ Unlighthouse has finished scanning http://127.0.0.1:7136: 5 routes in 20s.The report opens in your browser by itself. If it doesn't, copy the Report: address from the terminal into your browser. Leave the terminal open while you look at it: the report lives there. Press Ctrl + C when you're finished.
TipUnlighthouse uses the Chrome you already have and runs it hidden in the background. You won't see Chrome windows popping up.CarefulBe a good neighbour. A scan loads every page like a visitor would, but several at once, and it goes up to 200 pages by default. Full scans are for your own sites and clients who've said yes. For anyone else, use the gentle settings in Step 3: public pages only, at most 5, one at a time. Never point it at login pages or anything private.
finished scanning with a number of routes (pages), and the report shows a row for each page.If it breaks'npx' is not recognised + 3 more
'npx' is not recognised
'running scripts is disabled on this system'
npx.cmd instead of npx (for example npx.cmd unlighthouse --site https://www.your-site.co.uk). It's the same program.You don't have Chrome
.unlighthouse folder in your user folder, so the first run takes a little longer.It says 'Failed to queue routes for scanning'
https://, and try the full address with www. if the site uses it.