Skip to content

New rule: content/h1-title-alignment - H1 and title share no meaningful words #929

Closed

Description

@nc9

Problem

A page's <title> and its H1 should be about the same thing. When they share no meaningful words, search engines get two different signals for the page's topic, and readers who click a result for one phrase land on a heading about something else.

Real example from a public site review: the title targets "Reddit Visibility Services, SEO & AI Search" while the H1 reads "Be recommended by AI and showed on Google". Nothing in the H1 matches the phrase the title targets.

core/h1 checks that there is exactly one non-empty H1, but nothing compares it with the title.

Proposal

New rule content/h1-title-alignment, page scope, no network.

  • Tokenise the title and the first H1:
    • lowercase and Unicode-normalise
    • drop stopwords for the page's declared language, and drop pure numbers
    • light stemming, so service matches services
  • Remove the site's brand affix from the title before comparing. content/title-pattern-outlier already infers it (splitTitle, the brand norm).
  • Warn: no content word is shared, and both sides have at least 2 content words.
  • Info: the title and H1 are identical, character for character, on a page where the title carries more than the brand. That is a missed chance to target a second phrase, not an error.
  • Pass: at least one shared content word.
  • Skip:
    • no H1, or more than one H1 (core/h1 already reports those)
    • noindex pages
    • pages whose title is just the brand
    • languages we have no stopword list for (report as skipped, not passed)
  • The finding shows both strings so the fix is obvious.

Notes

  • Cost: string work on data every page already has.
  • False-positive risk: low to medium. Creative H1s on homepages ("Ship faster") are deliberate, so this is a warning, not an error, and the homepage could be info-only.

Acceptance Criteria

  • Fixture: title "Reddit Visibility Services, SEO & AI Search | Brand" with H1 "Be recommended by AI and showed on Google" produces a content/h1-title-alignment warning showing both strings
  • Fixture: title "Running Shoes for Women | Brand" with H1 "Women's running shoe guide" passes (stemming and brand stripping)
  • Fixture: a page with no H1, or two H1s, produces no finding from this rule
  • Fixture: a page whose lang has no stopword list is reported as skipped, not passed
  • Identical title and H1 produce at most an info finding
  • Docs page under docs/rules/content/

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrulessize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions