The inline-vs-block boundary rule is the whole article. Most strippers get it wrong because
one
two
→ onetwo is the bug everyone remembers, so they over-correct in the other direction and turn everything into a space.
Your build-from-the-same-string suggestion is stronger than the headingText() function, though — if the visible heading and the JSON-LD headline come from one source, the stripper becomes irrelevant for that pair. Did you end up doing that, or did the 62 pages get fixed by patching the generator?
The false positives you flagged (Learn .NET, Wait ..., Bonjour !) are worth keeping in the regex as exceptions rather than removing the check — the space-before-punctuation rule catches real bugs far more often than it cries wolf.
The "visual QA only checks the page humans see" line is going in my notes.
Founder of MyIPScan.net — a free network privacy toolkit: DNS/IPv6 leak tests, browser fingerprint check, IP exposure reports. We write practical guides on VPNs and home network security.
Thanks! Today the JSON-LD headline equals the visible H1 on 201 of 212 pages that have one. The other 11 differ on purpose: for example, the home pages in four languages use a descriptive headline, and the methodology pages add the version number. So one string can't cover every page, and the equality test needs a short list of allowed exceptions. Agreed on the regex: keep it strict and list the exceptions.
That makes sense. A 201/212 match rate is a pretty strong baseline, and the fact that the remaining 11 differences are intentional is exactly why a blanket equality rule would be too simplistic.
I'd keep the strict default and make the exceptions explicit, ideally tied to page type and a documented reason rather than just maintaining a list of URLs. That way, if a new mismatch appears, it fails the check instead of silently becoming another accepted exception.
One additional safeguard: the test should verify that every exception still has a valid JSON-LD headline and a visible H1, even when they aren't identical.
Are you planning to make those exceptions part of an automated regression test, so future content changes can't accidentally expand the exception list?
Founder of MyIPScan.net — a free network privacy toolkit: DNS/IPv6 leak tests, browser fingerprint check, IP exposure reports. We write practical guides on VPNs and home network security.
Not yet. Today it's a check I ran by hand, not something that runs on every build. Your version is better than a URL list: tie each exception to a page type and a reason, and fail on anything new. The extra assertion that every exception still has a headline and an H1 is a good catch too, since "different on purpose" shouldn't turn into "missing".
That's a good distinction. I'd also make sure exceptions don't become permanent just because they were once justified. Page structures change, and an exception that made sense today might hide a real issue six months later.
Ideally, the check should validate both sides: new unexpected differences fail the build, while existing exceptions are still required to meet their original conditions. That way, the exception list becomes part of the test rather than a way around it.
Founder of MyIPScan.net — a free network privacy toolkit: DNS/IPv6 leak tests, browser fingerprint check, IP exposure reports. We write practical guides on VPNs and home network security.
Agreed. An exception that still passes after the page has changed is a hidden failure with a green checkmark. Making each exception keep proving its original reason is the part I hadn't thought through. Thanks for pushing on this.
SEO monitoring tool. Crawls your site daily or hourly and alerts you when a noindex tag, robots.txt block, sitemap error or canonical change appears. Free plan.
Funny how the whitespace collapse hides half the damage: the double space disappears and only the one before the comma survives, so at a glance it looks fine. Building the heading and the headline from one string is the fix I'd push hardest, since it removes the drift instead of testing for it. How did you spot it in the first place, Rich Results Test or just reading the JSON-LD by chance?
Founder of MyIPScan.net — a free network privacy toolkit: DNS/IPv6 leak tests, browser fingerprint check, IP exposure reports. We write practical guides on VPNs and home network security.
Neither Rich Results Test nor the Schema Markup Validator would have caught it: a stray space is valid Text, so they show the string and stay green. That's the uncomfortable part. What guards it now is the comparison from the post. I reran it today on all 404 pages in the sitemap: zero headline, name or description fields with a space before punctuation.
SEO Specialist in Sharjah, UAE. Technical SEO, GEO/AEO and entity building. Managing client projects across the UAE, GCC and India. Writer at The SEO Central.
Location
United Arab Emirates
Education
BBA, University of Calicut
Work
SEO Specialist at YES Machinery | SEO Manager at GIRAF (BigLeap)
The equality check against the visible h1 is the strongest part, but on many sites the JSON-LD headline is meant to match the title tag instead, and the two intentionally differ (shorter h1, longer title). Worth allowing either source in the test so it does not train people to ignore failures. The other gap: if any client-side code rewrites headings after hydration, the built HTML passes while the rendered DOM drifts. Do you run the same assertion against the rendered page as well?
Founder of MyIPScan.net — a free network privacy toolkit: DNS/IPv6 leak tests, browser fingerprint check, IP exposure reports. We write practical guides on VPNs and home network security.
Good point, and my own site proves it: 11 of 212 pages have a headline that differs from the H1 on purpose, so an H1-only check would fail them every time. Accepting the title tag as a second source is a fair fix. On hydration, I checked today: on 37 pages rendered in a real browser, 20 of them with inline tags in the heading, the H1 after JavaScript was identical to the H1 in the built HTML. My headings are static, so the build check covers it. If a site rewrites headings client-side, the same two assertions can run in Playwright against the rendered DOM.
We're a place where coders share, stay up-to-date and grow their careers.
The inline-vs-block boundary rule is the whole article. Most strippers get it wrong because
one
two
→ onetwo is the bug everyone remembers, so they over-correct in the other direction and turn everything into a space.Your build-from-the-same-string suggestion is stronger than the headingText() function, though — if the visible heading and the JSON-LD headline come from one source, the stripper becomes irrelevant for that pair. Did you end up doing that, or did the 62 pages get fixed by patching the generator?
The false positives you flagged (Learn .NET, Wait ..., Bonjour !) are worth keeping in the regex as exceptions rather than removing the check — the space-before-punctuation rule catches real bugs far more often than it cries wolf.
The "visual QA only checks the page humans see" line is going in my notes.
Thanks! Today the JSON-LD headline equals the visible H1 on 201 of 212 pages that have one. The other 11 differ on purpose: for example, the home pages in four languages use a descriptive headline, and the methodology pages add the version number. So one string can't cover every page, and the equality test needs a short list of allowed exceptions. Agreed on the regex: keep it strict and list the exceptions.
That makes sense. A 201/212 match rate is a pretty strong baseline, and the fact that the remaining 11 differences are intentional is exactly why a blanket equality rule would be too simplistic.
I'd keep the strict default and make the exceptions explicit, ideally tied to page type and a documented reason rather than just maintaining a list of URLs. That way, if a new mismatch appears, it fails the check instead of silently becoming another accepted exception.
One additional safeguard: the test should verify that every exception still has a valid JSON-LD headline and a visible H1, even when they aren't identical.
Are you planning to make those exceptions part of an automated regression test, so future content changes can't accidentally expand the exception list?
Not yet. Today it's a check I ran by hand, not something that runs on every build. Your version is better than a URL list: tie each exception to a page type and a reason, and fail on anything new. The extra assertion that every exception still has a headline and an H1 is a good catch too, since "different on purpose" shouldn't turn into "missing".
That's a good distinction. I'd also make sure exceptions don't become permanent just because they were once justified. Page structures change, and an exception that made sense today might hide a real issue six months later.
Ideally, the check should validate both sides: new unexpected differences fail the build, while existing exceptions are still required to meet their original conditions. That way, the exception list becomes part of the test rather than a way around it.
Agreed. An exception that still passes after the page has changed is a hidden failure with a green checkmark. Making each exception keep proving its original reason is the part I hadn't thought through. Thanks for pushing on this.
Funny how the whitespace collapse hides half the damage: the double space disappears and only the one before the comma survives, so at a glance it looks fine. Building the heading and the
headlinefrom one string is the fix I'd push hardest, since it removes the drift instead of testing for it. How did you spot it in the first place, Rich Results Test or just reading the JSON-LD by chance?Neither Rich Results Test nor the Schema Markup Validator would have caught it: a stray space is valid Text, so they show the string and stay green. That's the uncomfortable part. What guards it now is the comparison from the post. I reran it today on all 404 pages in the sitemap: zero headline, name or description fields with a space before punctuation.
The equality check against the visible h1 is the strongest part, but on many sites the JSON-LD headline is meant to match the title tag instead, and the two intentionally differ (shorter h1, longer title). Worth allowing either source in the test so it does not train people to ignore failures. The other gap: if any client-side code rewrites headings after hydration, the built HTML passes while the rendered DOM drifts. Do you run the same assertion against the rendered page as well?
Good point, and my own site proves it: 11 of 212 pages have a headline that differs from the H1 on purpose, so an H1-only check would fail them every time. Accepting the title tag as a second source is a fair fix. On hydration, I checked today: on 37 pages rendered in a real browser, 20 of them with inline tags in the heading, the H1 after JavaScript was identical to the H1 in the built HTML. My headings are static, so the build check covers it. If a site rewrites headings client-side, the same two assertions can run in Playwright against the rendered DOM.