This was on the CogniPrep landing page until two days ago:
{/* Providers Section - hidden, SEO content only */}
<div className="sr-only">
<ProvidersSection />
</div>
ProvidersSection is 122 lines and it is a real piece of design. A responsive
grid, one card per assessment provider, each card with a zero-padded index
number, a label, a count of practice tests, an arrow that slides on hover, a
border that lightens on hover, a backdrop blur. It derives its list from the
provider catalogue so a new provider appears automatically.
Nobody has ever seen it. sr-only clips an element to a 1px box: screen readers
read it, sighted visitors do not, and the hover states it spends four classes on
cannot fire.
Inside it, there was a second layer:
{/* Hidden content for SEO / AI scraping */}
<div className="sr-only">
{PROVIDERS.map((provider) => (
<div key={provider.id}>
<h3>{meta.label} psychometric assessment practice</h3>
<p>{meta.description}</p>
<p>{games.length} games available for practice including:</p>
<ul>{games.map((g) => <li>{g.name}: {g.cognitiveTraits}</li>)}</ul>
</div>
))}
</div>
Hidden text inside hidden text, which tells you the two layers were added by two
different decisions, months apart, each one reasoning about what a crawler would
find rather than what a person would read.
Three things about it that I still enjoy
It had been performance optimised. The file's own header comment explains
that it used to be a Client Component, for two scroll-triggered fade-ups, and
that this cost the landing page the animation library in the initial bundle plus
roughly 4,400 lines of provider metadata shipped to the browser so the markup
could render there. So it was rewritten as a Server Component with a CSS
scroll-timeline reveal and no JavaScript. All of that work is correct, and all of
it was spent on a fade-up animation that could never be seen.
It had dead code inside it. The heading read "N platforms. One place to
practice", through this:
const COUNT_WORDS = ['Zero', 'One', 'Two', /* ... */ 'Twenty'];
function spellCount(n: number): string {
return COUNT_WORDS[n] ?? String(n);
}
A number-to-words helper with 21 entries and a digit fallback. The provider count
passed 20 long ago and is 73 today, so the only branch that can run is the
fallback. An unreachable nicety, inside an invisible section, on the most
important page of the site.
It was enormous. Running the same derivation over today's catalogue, 73
providers and 465 practice tests, the hidden block's text alone comes to 91,484
characters. The landing page's visible text, right now, is 5,131 characters. The
hidden copy was about eighteen times the size of the page.
Why it was deleted rather than un-hidden
The honest answer is that none of it was written to be read. Un-hiding it would
have meant publishing 91,000 characters of generated provider blurbs on a landing
page, which is not a design, it is a sitemap with adjectives. The provider list
already has a page of its own, every provider has a hub, and every named test has
its own page. The landing page's job is to say what the product is.
So the replacement is one visible sentence that names the product, where the old
copy had described the category and left the brand to the logo:
CogniPrep is practice for the numerical, verbal and logical reasoning,
situational judgement and personality tests employers set.
And the code now carries the rule rather than the trick:
{/* The outcome in the headline; what the product is goes in the
line under it, which names CogniPrep in visible copy. Nothing
here is hidden text: copy written only for crawlers is
against Google's spam policy and was removed from this page. */}
A second hidden element went with it, a hero sr-only paragraph whose own
comment said "Full detail kept in the DOM for search engines and AI crawlers,
hidden visually". That one is now two visible clauses, which is all it ever
needed to be.
The entity half of the same commit
The same page described the site to search engines in a way that had the same
flavour of trying too hard. Both are now fixed:
- The organisation's
alternateNamelisted four strings, two of which were other companies' products. It is now two spellings of our own name. Several unrelated apps share the name CogniPrep, so the entity has to be described cleanly to be told apart from them, and naming a competitor's product as our alternate name does the opposite. - The site node's
namewas "CogniPrep - Psychometric Test Practice", a name padded with a tagline, which leaves Google to guess which part is the brand. It is now "CogniPrep". - The site node and the organisation node now share stable
@idvalues and the site declares the organisation as its publisher, so they are one entity rather than two anonymous ones. -
sameAswent from one profile to six, which is the actual mechanism for distinguishing a small brand from its namesakes. - The web app manifest was called "CogniPrep - Arctic Shores Practice" and described the product as "all 14 Arctic Shores psychometric games". The site covers 73 providers and 465 tests. It now says neither a vendor's name nor a count.
The landing page also stated its own description three times, once for the
document, once for OpenGraph, once for Twitter, and the Twitter one had drifted
into a different list of providers. They are one constant now.
See it
Everything above is checkable on cogniprep.app with
view-source and grep.
curl -s https://cogniprep.app/ > home.html
grep -o 'sr-only' home.html | wc -l # 11
grep -o 'psychometric assessment practice' home.html | wc -l # 0
grep -o 'games available for practice' home.html | wc -l # 0
grep -o 'alternateName":\[[^]]*\]' home.html | head -1
# alternateName":["Cogni Prep","cogniprep.app"]
curl -s https://cogniprep.app/manifest.webmanifest
Count with grep -o | wc -l rather than grep -c, because the whole document is
two lines and grep -c counts lines, which is how a page can look like it holds
two of something when it holds eleven.
All 11 remaining sr-only occurrences are doing the job the class is for: the
skip link, the toast region, and an "(opens in a new tab)" label on each review
link. "Arctic Shores" and "Pymetrics" now appear zero times in the page's visible
text, and the provider names that remain are in the meta description, where a
list of what the site covers belongs.
Then compare it with a page that is allowed to list things, because listing is
what it is for: cogniprep.app/games.
Top comments (0)