> ## Documentation Index
> Fetch the complete documentation index at: https://docs.37audits.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Page Title Auditor

> Validates that the HTML page title is present and within the recommended 15–70 character range

<Info>
  **SEO Auditor** — validates that the HTML page title is present and within the recommended 15–70 character range.
</Info>

<CardGroup cols={2}>
  <Card title="SEO" icon="search">
    Titles that search engines can display in full and that describe the page.
  </Card>

  <Card title="Usability" icon="eye">
    Browser tabs and bookmarks show a unique, readable title instead of a blank or truncated one.
  </Card>
</CardGroup>

The HTML `<title>` is the primary snippet search engines show in results and the label browsers use for tabs and bookmarks. This auditor fetches the page, extracts the title with jsoup, and checks its presence, length, structure, and quality: duplicate title tags, CMS placeholder copy, all-caps titles, titles unrelated to the H1, and titles missing the site name.

## How it works

The auditor loads the audited URL and evaluates the first `<title>` element:

1. **Fetch** — requests the HTML with jsoup (including HTTP Basic Auth when provided).
2. **Extract** — reads `document.selectFirst("title")` and trims surrounding whitespace; also counts `<title>` elements, reads the first `<h1>`, and derives the site name from the hostname (first label after stripping `www.`).
3. **Rules** — applies missing, empty, excessively long (over 100), and duplicate-tag checks (FAIL), then too-short (1–14), too-long (71–100), placeholder, all-caps, H1-mismatch, and missing-brand checks (WARNING). Quality rules are skipped when the title is missing or empty.
4. **Aggregate** — any `FAIL` rule wins over `WARNING`; if every rule passes, the audit is `SUCCESS`.

Fetch errors (unreachable host, invalid URL) produce an `ERROR` response rather than a title finding.

## What it audits

Every row maps to one `checkRule*` method and one `CheckCode`. CheckCode suffixes use status ranges: `200` success, `300–399` warning, `400–499` fail.

| CheckCode                                                     | Status    | When it fires                                                                                                                                                                                                                 | Recommendation                                                                                 |
| ------------------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| <a id="37A-PageTitleAuditor-400" />`37A-PageTitleAuditor-400` | `FAIL`    | The document has no `<title>` element.                                                                                                                                                                                        | Add a unique `<title>` of 15–70 characters on `{url}`.                                         |
| <a id="37A-PageTitleAuditor-401" />`37A-PageTitleAuditor-401` | `FAIL`    | A `<title>` element is present but its text is empty after trim.                                                                                                                                                              | Put a unique page title of 15–70 characters in the `<title>` tag on `{url}`.                   |
| <a id="37A-PageTitleAuditor-402" />`37A-PageTitleAuditor-402` | `FAIL`    | The title is longer than 100 characters.                                                                                                                                                                                      | Shorten `"{title}"` from `{length}` characters to at most 70 so search results can display it. |
| <a id="37A-PageTitleAuditor-403" />`37A-PageTitleAuditor-403` | `FAIL`    | The document has more than one `<title>` element; browsers and crawlers use only the first.                                                                                                                                   | Keep a single `<title>` on `{url}`; remove the extra `{titleCount - 1}` title tag(s).          |
| <a id="37A-PageTitleAuditor-300" />`37A-PageTitleAuditor-300` | `WARNING` | The title is 1–14 characters.                                                                                                                                                                                                 | Expand the title beyond `"{title}"` so it describes the page in 15–70 characters.              |
| <a id="37A-PageTitleAuditor-301" />`37A-PageTitleAuditor-301` | `WARNING` | The title is 71–100 characters.                                                                                                                                                                                               | Shorten `"{title}"` to 15–70 characters so it displays fully in search results.                |
| <a id="37A-PageTitleAuditor-302" />`37A-PageTitleAuditor-302` | `WARNING` | The trimmed title exactly matches a known CMS placeholder (`Untitled`, `New Page`, `Welcome to Liferay`, and similar), case-insensitive.                                                                                      | Replace `"{title}"` with a unique description of this page in 15–70 characters.                |
| <a id="37A-PageTitleAuditor-303" />`37A-PageTitleAuditor-303` | `WARNING` | The title has at least 4 letters and every letter is uppercase.                                                                                                                                                               | Change `"{title}"` to sentence case so it reads naturally in search results.                   |
| <a id="37A-PageTitleAuditor-304" />`37A-PageTitleAuditor-304` | `WARNING` | A non-blank first `<h1>` exists and shares no significant tokens (3+ characters, punctuation stripped) with the title.                                                                                                        | Align `"{title}"` with the H1 `"{h1}"` so the search snippet matches the page heading.         |
| <a id="37A-PageTitleAuditor-305" />`37A-PageTitleAuditor-305` | `WARNING` | The site name from the hostname (first label after stripping `www.`, at least 4 letters; IPs and localhost exempt) does not appear in the title, even after ignoring spaces and punctuation (`37audits` matches `37 Audits`). | Add `"{brand}"` to the title, typically as a suffix such as `"{title} \| {brand}"`.            |
| <a id="37A-PageTitleAuditor-200" />`37A-PageTitleAuditor-200` | `SUCCESS` | Every rule above passed; one `SUCCESS` check is added with the message `Page title "{title}" is {length} characters, within the recommended 15–70 range.`                                                                     | —                                                                                              |

## Output documentation

| Status      | Description                                                              | Test logic                                                                                                                                                                |
| ----------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SUCCESS** | The page has a single, descriptive title of 15–70 characters             | One `<title>` is present, not blank after trim, `length` is between 15 and 70 inclusive, and no quality rule fires.                                                       |
| **WARNING** | The title is usable but weak for search snippets                         | Length is 1–14 (`300`) or 71–100 (`301`); placeholder copy (`302`); all capitals (`303`); no wording shared with the H1 (`304`); site name absent from the title (`305`). |
| **FAIL**    | The title is missing, empty, duplicated, or so long it will be truncated | No `<title>` (`400`); empty title (`401`); length greater than 100 (`402`); more than one `<title>` element (`403`).                                                      |

## Risks and considerations

### Search visibility

* Missing or empty titles force search engines to invent a snippet, which often mismatches the page and lowers click-through.
* Titles over 70 characters are typically truncated in SERPs; over 100 characters are almost never shown in full.

### Uniqueness and intent

* A two-word title like `"Hi"` does not describe the page. Expand it with the primary topic so results and tabs are distinguishable.
* Placeholder titles such as `Untitled` or `Welcome to Liferay` signal an unfinished page and are reused across sites, so they never differentiate the result.
* Reusing the same generic title across many URLs collapses rankings and analytics into one unhelpful label.

### Consistency and trust

* When the title and the H1 say different things, users who click the search result land on a page that does not match the snippet, increasing bounces.
* Including the site name in the title (usually as a suffix) builds recognition in results; the auditor infers the name from the hostname and treats spaces or hyphens as equivalent (`37audits` matches `37 Audits`). A title that uses a different spelling still warns.
* All-caps titles read as shouting, are harder to scan, and some engines rewrite them anyway.

### Whitespace and encoding

* Leading and trailing whitespace is trimmed before length is measured; a title of only spaces is treated as empty.
* Character count is the Java string length of the trimmed text, not a pixel-width estimate used by some SERP renderers.
* Only the first `<title>` element is measured; extra title tags are flagged separately and otherwise ignored, matching browser behavior.
