Skip to content

Duplicate H1: hidden screen-reader title H1 rendered alongside custom layout H1 when page title is hidden #4652

Open

Description

@pirate-bot

Summary

When a page's title is hidden and a Custom Layout supplies its own H1, the page ends up with two H1 headings. The second is Neve's visually hidden title.

Expected: only one H1 on the page, the one from the custom layout.
Actual: Neve outputs an extra H1 with the screen-reader-text class in addition to the custom layout H1.
Impact: SEO and heading-checker tools flag multiple H1s on the page.

Customer context

  • Product / area: Neve page header with Neve Pro Custom Layouts
  • Version: Not provided
  • Environment: Page using a custom layout with an H1 heading; the page title is hidden (inferred)
  • Integration / third party: Neve Pro custom layouts
  • Reported error / symptom: Two H1 headings reported on a page that uses a custom layout
  • Impact: SEO concern; customer is using a heading checker

Reproduction notes

Not reproduced. Likely steps (inference): 1) Hide the page title through the global setting or the per-page setting. 2) Add a Neve Pro Custom Layout that renders an H1. 3) Inspect the frontend HTML for two H1 elements. Missing: Neve and Neve Pro versions, and the exact custom layout hook.

Diagnosis

Conclusion

When the title is hidden, views/page-header.php outputs a visually hidden H1 unless it finds an H1 in the post's raw post_content. Markup injected by a custom layout or hook is not in post_content, so the check does not see it and a second H1 can render. This is inferred from reading the code; no runtime reproduction was done.

Where this likely occurs

  • views/page-header.php approx. lines 15-27 and 46-56 (hide-title decision and the else branch): $content_has_h1 is computed from get_post_field('post_content') only. If false, it echoes the screen-reader-text H1.
  • inc/views/page_header.php — Page_Header::run() line 43 and render_page_header() lines 53-67 hook the view into neve_page_header at priority 9.
  • The page the customer linked is not necessarily the blog page. The staff reply described the case as the blog/posts page, via is_home. The archive hide-title default at lines 21-23 of the view may be involved.

Engineering notes

The H1 check looks only at post content. It does not look at output from other sources such as Neve Pro custom layouts hooked into the page header. Neve Pro was only grepped for neve_page_header usage; the custom layout rendering code was not inspected in depth. Custom layouts may also inject at other hooks.

Test coverage status

No relevant coverage was found during inspection (not exhaustive).

What to verify or explore next

  • Reproduce with a Custom Layout containing an H1 on the posts page and on a regular page, with the title hidden, and count the H1 elements.
  • Check whether archive and blog pages hide the title by default for new users via neve_archive_hide_title.

Unknowns / follow-up

  • Theme and Pro versions, and the hook where the customer's layout renders.
  • Whether an open issue already tracks this.

Confidence

Confidence: 70/100

The hidden-title branch in views/page-header.php only checks the post's raw content for an H1. A custom layout that outputs its own H1 is not detected, so a second H1 renders. No existing GitHub issue was searched, and I did not inspect customer-side layout markup.


Source: HelpScout #3479313350
Generated by bug-report-triage (ID: bug-report-triage_6acb421c5ba113.05905873)

Activity

  1. added theissue type on Oct 11, 2026
  2. added a commit that references this issue on Oct 15, 2026
    1f278cc
  3. milicavs commented on Oct 17, 2026

    @milicavs

    🧪 QA steps and test links

    When a page's title is hidden, Neve adds a visually hidden H1 with the page title so the page still has a main heading. On Neve 4.2.16 it only looks for another H1 in the page's own content, so an H1 that comes from somewhere else (a synced pattern, a Neve Pro Custom Layout, the blog page) is missed and the page ends up with two H1s, which SEO and heading checkers flag.

    Link Build Bot check
    Reproduce the bug Neve 4.2.16 (released) ✅ Reproduced: two H1s, h1.screen-reader-text "Hidden title page" plus the pattern's "Heading from a synced pattern"
    Verify the fix PR #4658 build 0830d44 ✅ Fixed: one H1, the pattern's heading only

    In the links:

    • Steps 1 to 3 are already done, and the links open on the page from step 3 on the front end.
    • The front page shows the latest posts.
    • Tools → QA Logs shows debug.log.

    Reproduce on Neve 4.2.16:

    1. Patterns → Add New Pattern: name it "QA heading pattern", turn Synced on, add a Heading block set to H1 ("Heading from a synced pattern") and publish.
    2. Pages → Add New Page "Hidden title page": insert the synced pattern and a paragraph.
    3. In the editor's Neve options sidebar (Neve icon, top right), turn on Disable Title, then publish and view the page.
    4. In the browser console, run document.querySelectorAll('h1') (or use a heading checker extension).
    • Bug: 2 H1s: a hidden h1.screen-reader-text with the page title, plus the pattern's H1.
    • Fixed: 1 H1, the pattern's heading. No screen-reader-text H1.
    Edge cases
    • Hidden title, no H1 anywhere on the page: exactly one h1.screen-reader-text with the page title.
    • Hidden title, H1 Heading block typed straight into the page content: no screen-reader H1.
    • Title left visible: the normal visible title H1 only, and no neve-fallback-h1 comment in the page source.
    • Settings → Reading with a static front page and a posts page, posts page title hidden: the posts page has exactly one H1 (with Neve Pro, add a Custom Layout with an H1 on the before-loop hook: still one).
    • With Neve Pro: a Custom Layout with an H1 on the before-content, after-header or before-footer hook, or an inside-content layout: no screen-reader H1.

    Fix: #4658 (open)

  4. pirate-bot commented on Oct 17, 2026

    @pirate-bot
    CollaboratorAuthor

    QA agent — 🔴 Has problems · Duplicate H1s are fixed, but large JSON scripts can still remove a page’s only heading.

    I tested actual Neve Pro Custom Layouts, synced patterns, normal content, and title settings using a seeded Pro license. The affected pages had two H1s on the base build and one on the candidate, including every requested layout placement and the posts page. Ordinary fallback headings work, but a 1.2 MB inert JSON script containing literal H1 markup leaves a hidden-title page with no H1. That defect also occurs on the base build; it is not a new regression.

    Problems found

    • ❌ A hidden-title page with no real H1 renders exactly one h1.screen-reader-text containing its page title.
      Ordinary pages, small inert scripts/comments/templates/noscript, and title-setting overrides pass. With PHP's default pcre.backtrack_limit=1000000, a valid 1.2 MB inert JSON script containing the literal string '

      Not a real heading

      ' leaves the candidate page with zero actual H1s on initial load and reload; 100 KB yields the required one fallback. The identical large fixture also has zero H
      🐞 Existing bug: also fails on the base build. Not reported yet.

      A hidden-title page with no real H1 renders exactly one h1.screen-reader-text co

    Checks (5 passed)
    • ✅ A hidden-title page with a Neve Pro Custom Layout H1 renders exactly that one H1 and no screen-reader fallback, for before-content, after-header, before-footer and inside-content placements.
    • ✅ With a static front page and a separate hidden-title posts page, a Neve Pro Custom Layout H1 on neve_before_loop is the posts page's only H1.
    • ✅ A hidden-title page with an H1 block directly in its content renders that H1 without a screen-reader fallback.
    • ✅ A hidden-title page with its H1 in a synced pattern renders only the pattern's H1 and no screen-reader fallback.
    • ✅ A page whose title is visible renders the normal title H1 and no neve-fallback-h1 placeholder in the HTML source.

    Full report, evidence and session trail

  5. pirate-bot commented on Oct 19, 2026

    @pirate-bot
    CollaboratorAuthor

    QA agent — Waiting for code review before testing.
    QA continued on its own after pirate-bot posted the review it asked for.

    QA tests a fix only after every fix PR has an approved code review. Right now:

    What happens next

    • The author pushes a fix and moves this issue back to Ready to Test. QA asks pirate-bot for a new review.
    • If a maintainer accepts the current commits, they approve the PR on GitHub and move this issue back to Ready to Test.
    • When every PR is approved, QA runs within the hour of the move.

    Run qa-agent_6ad5c2c7a44074.99215087 · Full report, evidence and session trail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions