# HTML structure audit rules

> Find all 12 Sonjoo HTML structure rules by ID, with the evidence and inputs each check uses.

Canonical documentation: <https://sajaddehshiri.ir/sonjoo-seo-audit/features/rules/htmlval/>

Sonjoo groups 12 checks under **HTML structure** (`htmlval`). Select this category with `sonjoo audit <url> --categories htmlval`, or pass the category ID in an [HTTP audit request](https://sajaddehshiri.ir/sonjoo-seo-audit/api/reference/#start-request-options).

This category has weight **2** in the overall audit score when it has scored results. Sonjoo normalizes category weights over the categories with scored results.

[All audit categories](https://sajaddehshiri.ir/sonjoo-seo-audit/features/rules/) · [Rule settings and interpretation](https://sajaddehshiri.ir/sonjoo-seo-audit/features/rules/#use-a-rule-id)

## htmlval-missing-doctype

Require the modern HTML doctype at the start of a document, after permitted comments or ASCII whitespace. The optional about:legacy-compat system identifier is valid for HTML generators.

**Inputs.** HTML source was collected.

**Evidence.** Presence and actionable HTML doctype instruction.

Base scoring weight **15** when measured.

## htmlval-missing-charset

Identify nonempty HTML encoding declarations in head, distinguish transport-only encoding, and fail when no declaration is available.

**Inputs.** HTML source was collected.

**Evidence.** Encoding method and declared value when present.

Base scoring weight **15** when measured.

## htmlval-invalid-head

Report body content explicitly placed in a source head. Inline script text and templates do not place their tag-like contents directly in head.

**Inputs.** HTML source was collected.

**Evidence.** Invalid source element names and distinct count.

Base scoring weight **10** when measured.

## htmlval-noscript-in-head

Check that head noscript contains only metadata allowed by the head-specific noscript content model.

**Inputs.** HTML source was collected.

**Evidence.** Distinct disallowed element names and count.

Base scoring weight **5** when measured.

## htmlval-multiple-heads

Count explicit head declarations without counting markup in comments or script strings; flag more than one.

**Inputs.** HTML source was collected.

**Evidence.** Number of explicit head start tags.

Base scoring weight **10** when measured.

## htmlval-size-limit

Measure UTF-8 bytes of the collected HTML string and report size tiers for delivery overhead.

**Inputs.** HTML source was collected.

**Evidence.** Measured byte size and crossed tier.

Base scoring weight **8** when measured.

## htmlval-lorem-ipsum

Flag explicit conventional lorem-ipsum phrases in visible body copy.

**Inputs.** HTML source was collected.

**Evidence.** Matched phrases as source text.

Base scoring weight **5** when measured.

## htmlval-multiple-titles

Count HTML document titles, excluding titles in SVG and MathML namespaces, with no more than one permitted.

**Inputs.** HTML source was collected.

**Evidence.** HTML title count and conflicting titles.

Base scoring weight **12** when measured.

## htmlval-multiple-descriptions

Count description metadata names case-insensitively and fail when more than one is present.

**Inputs.** HTML source was collected.

**Evidence.** Count and duplicate description values.

Base scoring weight **10** when measured.

## htmlval-title-outside-head

Report document title elements placed outside the metadata head; ignore titles in SVG and MathML namespaces.

**Inputs.** HTML source was collected.

**Evidence.** Number of misplaced titles and their text.

Base scoring weight **12** when measured.

## htmlval-base-url

Check authored base href values and detect competing base elements. A single HTTP(S) or resolvable relative base is valid.

**Inputs.** HTML source was collected.

**Evidence.** Authored base hrefs and problem reason.

Base scoring weight **6** when measured.

## htmlval-body-structure

Check for multiple explicit body start tags, a body before html, or substantive content before an explicitly authored head.

**Inputs.** HTML source was collected.

**Evidence.** Specific source-order defect and source offset.

Advisory. Excluded from scoring.
