Technical
TechnicalInfo

Inline JavaScript

Checks for inline <script> blocks — affects CSP and caching.

What this check measures

We count inline `<script>` elements without src. Similar to inline CSS — excessive inline JS prevents caching and blocks strict CSP.

Why it matters

Inline scripts re-parse on every page load (vs. cached external). Strict CSP requires either unsafe-inline (defeats CSP) or per-script nonces (maintenance burden).

search

How our audit detects it

Count <script> tags without src attribute. Flag pages with more than ~3.

Typical findings

  • error_outlineAnalytics inline on every page.
  • error_outlineHydration script inline with large JSON state.

How to fix

Move to external JS files. For hydration state, use JSON attributes or fetch-after-hydrate. For third-party snippets, use the `async` attribute.

Frequently asked questions

Is any inline JS bad?expand_more
No — small initialization scripts are fine. The pattern to avoid is large inline scripts repeated on every page.

Want this checked on your site?

Pantra runs the full audit (SEO, Security, GEO, Performance, Schema, Technical, Images) in 10 seconds and generates stack-specific fix prompts.

Scan my site

Related checks