Validates page title length and SEO optimization
The auditor loads the audited URL and evaluates the first <title> element:
Fetch β requests the HTML with jsoup (including HTTP Basic Auth when provided).
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.).
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.
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.
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 |
|---|---|---|---|
37A-PageTitleAuditor-400 | FAIL | The document has no <title> element. | Add a unique <title> of 15β70 characters on {url}. |
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}. |
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. |
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). |
37A-PageTitleAuditor-300 | WARNING | The title is 1β14 characters. | Expand the title beyond "{title}" so it describes the page in 15β70 characters. |
37A-PageTitleAuditor-301 | WARNING | The title is 71β100 characters. | Shorten "{title}" to 15β70 characters so it displays fully in search results. |
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. |
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. |
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. |
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}". |
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. | β |
| 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). |
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.
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.
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.
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.
Add this auditor to your monitoring setup and start identifying issues on your websites today.