DEV Community

Daniel Pertu
Daniel Pertu

Posted on

Exact-match says 2 duplicated sentences in 628 across our 67 pages, and the real answer is 5 of 6 paragraphs on one page

Sixty-seven pages of our site are prose written to be found in a search, in six clusters: features, solutions, guides, question sets, comparisons and free tools. The standard failure of a set like that is well known. You write page one carefully, then page thirty is page twelve with the nouns changed, and now you have two pages competing for the same query with half an argument each.

The copy is data rather than JSX, so I can count instead of guess. Every page's body is an array:

export type ContentSection = {
    heading: string
    paragraphs: string[]
    points?: { term: string; detail: string }[]
}
Enter fullscreen mode Exit fullscreen mode

Which means a duplicate-content audit on your own site is a dictionary and a loop, not a crawler.

The reassuring numbers

Thing counted Total Distinct
Section headings 315 272
Paragraphs 628 626
Labelled points (term) 154 154
Closing call-to-action headings 67 67

22,398 words of prose over 67 pages, 334 a page on average. Two paragraphs out of 628 appear twice. 154 labelled terms and not one repeat.

The 43 repeated headings are almost all one deliberate pattern: the question-set pages carry "Easy", "Medium" and "Hard" on 11 of 14, and "How to use this round" on 9. A repeated heading over different words underneath it is a template, not duplication, and the three bands are the point of those pages. That leaves five pairs of genuinely coincidental repeats, things like "Afterwards" and "The week before".

Then the two duplicated paragraphs, and they are not random either. Both sit between a guide and the free tool that belongs to it:

$ curl -s https://pub-trivia.app/guides/pub-quiz-format | grep -c 'Put the halfway standings up during it'
1
$ curl -s https://pub-trivia.app/tools/round-planner | grep -c 'Put the halfway standings up during it'
1
Enter fullscreen mode Exit fullscreen mode

Same for the team names guide and the team name generator. Two sentences in 628 is 0.3 per cent, both of them explicable. I nearly stopped there.

The number that matters is not the exact match

Nobody rewrites a page by pasting it. They paste it and then tidy it, and the tidying is what defeats string equality. So I cut every page's prose into overlapping six-word sequences and intersected each pair of pages, scoring against the smaller of the two so that a short page absorbed into a long one cannot hide.

Forty-four of the 2,211 page pairs share any six-word sequence at all. The top two are the same two pairs, and the first one is nothing like 0.3 per cent:

0.689  guides/pub-quiz-team-names   tools/team-name-generator
0.202  guides/pub-quiz-format       tools/round-planner
0.112  guides/writing-quiz-questions quiz-questions/general-knowledge
0.076  faq                          features/qr-code-quiz-joining
0.074  guides/charity-quiz-night    solutions/charity-fundraisers
Enter fullscreen mode Exit fullscreen mode

Sixty-nine per cent. Lined up paragraph by paragraph with a similarity ratio, the team name generator has six paragraphs of prose, and five of them are the team names guide:

ratio  words  page
0.92   22     It is read out loud, once, to a room that is half listening...
1.00   43     Which rules out most of what people write down...
0.99   49     The ones that land are short, say out loud cleanly...
0.83   18     Teams that arrive and then spend ten minutes on a name...
0.51   53     Pick something you would not mind hearing read out in last place...
0.00   32     Award a point for the best team name...
Enter fullscreen mode Exit fullscreen mode

Open the two pages and read down them together. The exact-match audit caught the 1.00 row. The 0.92 row differs by three words at the end of a sentence. The 0.83 row dropped a four-word opening clause. The 0.99 row changed one word. By the only measure that matters, which is whether a reader who has read one has read the other, all five are the same paragraph, and a search engine deciding which of our two pages answers "pub quiz team names" is choosing between a page and 85 per cent of its own words with a widget on top.

The second pair is the opposite result, and worth the contrast. The round planner and the quiz format guide score 0.202, and when you line them up, exactly one of the planner's nine paragraphs matches anything in the guide: the one the exact-match audit already found. The other eight are about the planner's own subject, which is timings. Twenty per cent overlap turned out to be one shared sentence between two pages that genuinely say different things. The aggregate score told me where to look and nothing more.

Why it happens in that direction

Both duplicated pairs run the same way: a tool page reusing the guide's argument. That makes sense from how they got written. A tool page needs prose around the widget, the guide next door already contains the correct opinion, and the correct opinion is right there in the repository as an array of strings.

The internal links tell the same story and give it an edge. Every page's registry node names its related pages, and in both pairs the relationship is one-way:

/tools/team-name-generator  related: ['/guides/pub-quiz-team-names', '/tools/round-planner', '/features/team-scoring']
/guides/pub-quiz-team-names related: ['/guides/how-to-host-a-pub-quiz', '/guides/pub-quiz-round-ideas', '/features/team-scoring']
Enter fullscreen mode Exit fullscreen mode

The tool cites the guide. The guide does not link back to the tool. So the page carrying the borrowed copy is the one pointing at the original, and the original has no link to the page people would actually rather use, which is the one where you tap a button and get a name.

The fix for the team name generator is not deduplication, it is deciding what that page is for. It exists so somebody standing at the bar can produce a team name in one tap. The reason a name works, read out to a half-listening room, is the guide's job and the guide does it over 418 words. The tool needs two sentences and a link, plus the one paragraph that is only true of the generator. Two thirds of its prose can go, and the guide should gain a link back to it.

The part the numbers cannot do

Six-word shingles catch a paste and a tidy. They do not catch two pages that make the same argument in different words, which is the more common way a cluster goes thin, and no string comparison will. The audit that would catch it is reading the two pages next to each other, which I only did because a number told me which two.

If you want to try the same measurement on your own site, the useful details are these: score the intersection against the smaller page, not the union, or a short page absorbed into a long one scores as clean. Use shingles of five or six words, because three-word sequences match everywhere and ten-word sequences match almost nothing once somebody has tidied. And treat the score as a sort order rather than a verdict: of my top two results, one was a page that should not exist in its current form, and one was a single shared sentence. The number told me where to read. It did not tell me what was wrong.

The 67 pages are all reachable from the six hubs: features, solutions, guides, question sets, comparisons and tools. The two pages above are the worst pair on the site, and you can read both in about a minute.

Top comments (0)