Skip to main content
sus.botdocs
  • SEO
  • AI
  • QA
  • Privacy
  • Accessibility
  • Security
  1. Docs
  2. SEO
  3. Page speed and Core Web Vitals
  4. A script or stylesheet is mostly unused on every page that loads it

SEO finding

A script or stylesheet is mostly unused on every page that loads it

SEO Warning Severity: Medium

Part of the audit Page speed and Core Web Vitals. Finding id: seo.unusedJsCss.

What it costs you

Visitors download code their page never runs, and the browser still has to read it. Phones on slow connections feel it most.

What to do

Send each page the code it uses.

What it checks

  • Unused script and style code

How to fix it

Load the third-party file later or drop it

  1. Ask who uses the tool behind [url]. If nobody does, remove its tag.
  2. If it is used, load it after the page is usable, or only on the pages that need it.

How to check: Run the lab test again and run this rule again.

Split or trim the stylesheet

  1. Open [example page] with the Coverage panel of the browser's developer tools and see which rules are used.
  2. Move rules that only one template uses into a stylesheet of that template.
  3. Delete rules that no page uses. Check pages after a click or a form error too, since their styles are not used on load.

How to check: Run the lab test again and run this rule again.

Split or trim the script

  1. Open [example page] with the Coverage panel of the browser's developer tools and see which parts of the file run.
  2. Remove libraries nothing calls.
  3. Load code for one feature only on the pages that have the feature, or only when the visitor first uses it.

How to check: Run the lab test again and run this rule again.

A real case

Vodafone split paid traffic between two versions of a landing page that differed only in loading speed. The version with a 31% better Largest Contentful Paint made 8% more sales.

Source: Vodafone case study on web.dev, 17 March 2021

Thresholds

Thresholds for A script or stylesheet is mostly unused on every page that loads it
NameDefaultMeaning
min_unused_bytes20000A file is reported when at least this many bytes of it go unused on every page that loads it. Our own choice, not a published limit.
min_unused_pct50A file is reported when at least this share of it, in percent, goes unused on every page that loads it. Our own choice, not a published limit.

How to verify by hand

The Coverage panel of the browser's developer tools, after using the menus, forms and dialogs of the page.

What this relies on

Code that does not run while the page loads in the lab is not needed for that page.

  • All audits
  • About sus.bot
  • Open the app
  • Contact support