Repository navigation
Duplicate H1: hidden screen-reader title H1 rendered alongside custom layout H1 when page title is hidden #4652
Description
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.phpapprox. lines 15-27 and 46-56 (hide-title decision and theelsebranch):$content_has_h1is computed fromget_post_field('post_content')only. If false, it echoes thescreen-reader-textH1.inc/views/page_header.php—Page_Header::run()line 43 andrender_page_header()lines 53-67 hook the view intoneve_page_headerat 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
fix: avoid a duplicate H1 when a hidden title's page provides one els…
milicavs commentedon Oct 17, 2026
🧪 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.
h1.screen-reader-text"Hidden title page" plus the pattern's "Heading from a synced pattern"0830d44In the links:
debug.log.Reproduce on Neve 4.2.16:
document.querySelectorAll('h1')(or use a heading checker extension).h1.screen-reader-textwith the page title, plus the pattern's H1.screen-reader-textH1.Edge cases
h1.screen-reader-textwith the page title.neve-fallback-h1comment in the page source.Fix: #4658 (open)
pirate-bot commentedon Oct 17, 2026
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.
Checks (5 passed)
Full report, evidence and session trail
fix: scan the body for an H1 without a regex that can exhaust the bac…
pirate-bot commentedon Oct 19, 2026
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:
6e633c29) — changes requested; the next push gets a new reviewWhat happens next
Run
qa-agent_6ad5c2c7a44074.99215087· Full report, evidence and session trail