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.17 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"0fe4373In the links:
debug.log.Reproduce on Neve 4.2.17:
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.<style>,<textarea>or<script>in a Custom HTML block: the screen-reader H1 stays.<div data-tpl="<h1>x</h1>"><p>Text</p></div>, also with a custom tag like<my-widget>): the screen-reader H1 stays.<svg>(for example in its<title>or<style>) in a Custom HTML block: the browser shows it as a real H1, so no screen-reader H1.Fix: #4658 (open)
fix: scan the body for an H1 without a regex that can exhaust the bac…
fix: treat template contents as nested markup in the H1 scan
fix: skip attribute values in the H1 scan
rodica-andronache commentedon Oct 22, 2026
@pirate-bot test
fix: recognise custom element tags in the H1 scan
fix: skip every raw-text element in the H1 scan
pirate-bot commentedon Oct 23, 2026
QA agent — 🔴 Has problems · Custom Layout duplicates are fixed, but heading-parser edge cases still fail.
With licensed Neve Pro fixtures, the reported Custom Layout, posts-page and synced-pattern duplicates are fixed. A 35-case rendered-heading matrix still found three missing-heading cases around SVG/MathML integration points and two duplicate-heading cases after unusual script/style end tags. The missing headings also occur on the base build; the end-tag duplicates are new. The PR’s 52 PHP tests and added synced-pattern browser test pass, but do not cover these failures.
Problems found
❌ A title-hidden page with no rendered H1 retains exactly one h1.screen-reader-text containing its page title, including when H1-like text occurs only in inert markup.
Ordinary fallback and 21/24 inert-markup cases pass. Three title-hidden pages have zero actual DOM H1s and zero fallback: <title><style>
Not heading
</style></title>, <style>Not heading
</style>, andNot heading
. Chromium treats these strings as raw text or inert template content, so the req🐞 Existing bug: also fails on the base build. Not reported yet.
❌ A title-hidden page with an H1 block directly in its content keeps the content heading as its only H1 and adds no screen-reader H1.
The ordinary direct H1 and 9/11 real-heading boundary cases pass. Both extraneous-end-tag-attribute fixtures render two actual H1s on HEAD: the hidden page-title fallback and 'QA Matrix Real H1' from the core Heading block. Chromium closes script/style despite the extra attribute. Both fixtures render only the content H1 on qa-base; the same replay fails after restoring HEAD. This is a new duplica
Worth a human look
Checks (4 passed)
Full report, evidence and session trail
fix: honour end-tag attributes and all integration points in the H1 scan
pirate-bot commentedon Oct 23, 2026
QA agent — Testing could not finish. No automatic attempts remain; human QA is required.
Review the blocked observations and their requirement sources before treating them as product defects. Confirmed checks and saved evidence are included below.
Checks (6 passed · 1 not tested)
Full report, evidence and session trail
fix: avoid a duplicate H1 when a hidden title's page provides one els…