Most teams first look at accessibility one page at a time: someone opens Lighthouse on the home page, sees a score of 84 and a list of failures, fixes a few, and moves on. The trouble is that most accessibility failures do not live on a page. They live in a component: the header search box with no label, the icon-only buttons in the cart drawer, the grey-on-white text in the footer, the card component with an empty link. Fix the component once and every page that uses it gets better.
This post runs Lighthouse's accessibility audits on a sample of pages, groups the failures by page template, and gives you a short list ordered by "how many pages does this break". It is a first pass, not an audit: the last section is about what it cannot find.
What Lighthouse checks, and what the score means
Lighthouse's accessibility category runs a set of automated rules from axe-core, the open-source engine behind many accessibility tools. Each rule either passes or fails for the page, and the category score is a weighted average of those pass/fail results. Some examples of rules and their audit IDs:
-
color-contrast: text that does not meet the WCAG contrast ratio against its background. -
image-alt: images with noaltattribute. -
link-nameandbutton-name: links and buttons with no accessible name, typically icon-only controls. -
label: form fields with no associated label. -
heading-order: headings that skip levels. -
html-has-langanddocument-title: page-level basics. -
aria-*rules: ARIA attributes that are invalid, misspelled or used on the wrong role.
Two things follow from how the score is built. First, a rule fails the same way whether one element or fifty elements break it, so the score does not tell you how bad a failure is. Second, a score of 100 means every automated rule passed, not that the page is accessible. Plenty of real barriers are invisible to an automated rule.
So we will ignore the score and count rule failures across pages instead.
Pick the pages by template
Thirty pages is plenty. Every page built from the same template shares most of its markup, so ten product pages tell you little more than three. One page from each template tells you a lot. List the templates your site has (home, category or listing, product or service detail, article, landing page, search results, account sign-up, checkout, contact, legal) and take two to four of each. Your sitemap or analytics top-pages report is a good place to pick them from.
Only public pages will work, because Google's servers fetch them. Sign-in, cart and checkout pages behind a login cannot be audited this way; test those by hand.
Accessibility results rarely differ between the mobile and desktop runs, except where the layout itself changes (a hamburger menu on mobile, a full navigation bar on desktop). Run mobile first. If your mobile and desktop navigation are different components, run desktop too.
Run the audits
PageSpeed Insights Audit is an open-source Apify Actor that calls Google's official PageSpeed Insights API and returns one record per URL and strategy. Two settings matter here:
- Categories: set it to accessibility only. Lighthouse then skips the performance, best-practices and SEO categories, which makes each audit faster.
-
Include audit details: switch it on. Each record then carries
failedAudits[], the failing audits with theirid,title,categoryandscore, most heavily weighted first, up to 15 per page.
Paste your pages into Page URLs and click Start, or send this input (placeholder domain, trimmed):
{
"urls": [
"https://www.yoursite.example/",
"https://www.yoursite.example/shop/",
"https://www.yoursite.example/shop/lamps/",
"https://www.yoursite.example/product/brass-desk-lamp/",
"https://www.yoursite.example/product/linen-shade/",
"https://www.yoursite.example/journal/",
"https://www.yoursite.example/journal/choosing-warm-light/",
"https://www.yoursite.example/contact/"
],
"strategy": "mobile",
"categories": ["accessibility"],
"includeAuditDetails": true
}
A successful record looks like this (trimmed):
{
"url": "https://www.yoursite.example/product/brass-desk-lamp/",
"strategy": "mobile",
"success": true,
"scores": { "performance": null, "accessibility": 81, "bestPractices": null, "seo": null },
"failedAudits": [
{ "id": "button-name", "title": "Buttons do not have an accessible name", "category": "accessibility", "score": 0 },
{ "id": "color-contrast", "title": "Background and foreground colors do not have a sufficient contrast ratio.", "category": "accessibility", "score": 0 },
{ "id": "heading-order", "title": "Heading elements are not in a sequentially-descending order", "category": "accessibility", "score": 0 }
]
}
Pages Google cannot load come back as success: false with an errorType, so nothing silently disappears from your list.
Count failures by template
Export the dataset as JSON (the Export button on the run's Storage tab, or the dataset items URL from the API) and save it as audits.json. The script below maps each URL to a template with a few path rules, then counts, for each failing rule, how many pages and how many templates it appears on.
import json
import re
from collections import defaultdict
# Edit these to match your URL structure. The first match wins.
TEMPLATES = [
(r"^/$", "home"),
(r"^/shop/?$", "shop index"),
(r"^/shop/[^/]+/?$", "category"),
(r"^/product/", "product"),
(r"^/journal/?$", "journal index"),
(r"^/journal/", "article"),
]
def template_for(url):
path = re.sub(r"^https?://[^/]+", "", url) or "/"
for pattern, name in TEMPLATES:
if re.search(pattern, path):
return name
return "other"
records = json.load(open("audits.json", encoding="utf-8"))
ok = [r for r in records if r.get("success")]
failed = [r for r in records if not r.get("success")]
pages_per_template = defaultdict(int)
rule_pages = defaultdict(set)
rule_templates = defaultdict(set)
titles = {}
for r in ok:
t = template_for(r["url"])
pages_per_template[t] += 1
for a in r.get("failedAudits") or []:
if a["category"] != "accessibility":
continue
rule_pages[a["id"]].add(r["url"])
rule_templates[a["id"]].add(t)
titles[a["id"]] = a["title"]
print(f"{len(ok)} pages audited, {len(failed)} failed to load")
print("pages per template:", dict(pages_per_template))
print()
print(f"{'rule':<28}{'pages':>6}{'templates':>11} title")
rows = sorted(rule_pages, key=lambda k: (-len(rule_pages[k]), -len(rule_templates[k]), k))
for rule in rows:
print(f"{rule:<28}{len(rule_pages[rule]):>6}{len(rule_templates[rule]):>11} {titles[rule][:60]}")
The output is a short table. An illustrative example of the shape (not a real site):
30 pages audited, 0 failed to load
pages per template: {'home': 1, 'shop index': 1, 'category': 6, 'product': 10, 'journal index': 1, 'article': 8, 'other': 3}
rule pages templates title
color-contrast 30 7 Background and foreground colors do not have a sufficient ...
button-name 30 7 Buttons do not have an accessible name
link-name 16 2 Links do not have a discernible name
image-alt 10 1 Image elements do not have `[alt]` attributes
heading-order 9 2 Heading elements are not in a sequentially-descending order
label 1 1 Form elements do not have associated labels
Read the table
Work from the top, and read the two count columns together.
-
Every page, every template (the first two rows above): the cause is in the shared layout, usually the header, footer or a site-wide widget such as a cookie banner or chat launcher. Open any affected page in Chrome DevTools, run Lighthouse, expand the audit and look at the elements it lists. If they all sit inside
<header>or<footer>, that is one fix for the whole site. -
Many pages, one or two templates (
link-name,image-altabove): the cause is a component used on those templates, like the product card on category pages or the image block in articles. Fix the component, not the pages. - One page: content, not code. Someone uploaded an image without alt text or pasted a form into a single page. Fix it, then ask whether the editor should make that field required.
The score field in failedAudits[] is the audit's own pass/fail result, so it is 0 for nearly every failing rule. It does not rank how serious a failure is; the page and template counts do that job here.
Two cautions about the counts. The Actor keeps up to 15 failing audits per page. On a page with more than 15 failing accessibility rules the least-weighted ones drop off, so treat the counts as a lower bound on very broken pages. And Lighthouse reports a rule as failing, not how many elements fail it. One unlabelled button and forty unlabelled buttons look the same here; the DevTools report shows the element list.
After the fixes ship, run the same URLs again and compare the tables. A rule that moves from "30 pages" to "0 pages" is a fix you can verify without opening a single report.
What this cannot tell you
Automated rules catch a useful but limited share of accessibility problems. They are good at things a machine can check from the markup: missing names, missing alt attributes, contrast ratios, invalid ARIA. They cannot judge whether alt text is meaningful, whether the focus order makes sense, whether a custom dropdown works with a keyboard, whether error messages are announced to a screen reader, or whether content still works at 200 percent zoom. Lighthouse lists several of these as "additional items to manually check" for exactly that reason.
So use this sweep to clear the mechanical failures cheaply and site-wide, then spend human time where it is needed: tab through your main flows with a keyboard, try a screen reader (VoiceOver or NVDA, both free) on the sign-up and checkout pages, and zoom to 200 percent. If you need to claim WCAG conformance for a contract or a legal requirement, that needs a proper manual audit; a Lighthouse score is not evidence of conformance.
Cost and limits
The Actor charges a flat $0.004 per successfully audited page and strategy.
- 30 pages on mobile is 30 audits: 30 x $0.004 = $0.12. Re-running after the fixes is another $0.12.
- Adding desktop doubles it to $0.24 per sweep.
- Invalid URLs, pages Google cannot load and quota errors come back with
success: falseand cost nothing, and a run stops at the maximum cost you set.
Limits to plan around:
- Public pages only. Google must be able to fetch the page, so pages behind a login or on a private staging host fail with
http-error. - Lighthouse audits the page as first loaded. Menus, modals and drawers that only appear after a click are not checked unless they are already in the DOM, hidden or not; check those by hand.
- By default the Actor uses a built-in Google API key shared by all its users. When the quota runs out you get free
rate-limitedrecords; retry later or paste your own free key into Google API key.
If this saves you time, a review on the Store page helps other people find it, and a star on GitHub helps too.
Disclosure: I built this Actor. Source: github.com/josh99smith/pagespeed-insights-audit. PageSpeed Insights and Lighthouse are Google trademarks; the Actor is not affiliated with Google.
Top comments (1)
The 'ignore the score, count the failures' line is the whole post — a page scoring 84 while 30 pages fail the same header rule is worse than a 60 with one honest bug. The $0.12-per-sweep math is what makes this repeatable for a solo dev. One thing I'd add to the method: the 15-audit cap per page means a template with 40 failures looks identical to one with 15 until the first batch is fixed — did you hit the cap on any real site, and did it distort the 'every page, every template' row?