Placing keywords you can actually count
A placement rule that fits on one line, and why counting them in your source file gives the wrong answer.
7 min read
Curious
0 XPKeyword rules go wrong in two directions. Too vague and Claude stuffs. Too rigid and the prose reads like it was built out of a spreadsheet.
The version that works is a placement rule, not a density target:
PRIMARY keyword: - meta title - meta description - H1 - exactly ONE H2 - exactly TWICE in body prose Each SECONDARY keyword: - once in body text Anything beyond that: soften it to a variant.
Cap it, do not floor it
"At least twice" turns into eleven. "Exactly twice" turns into two, and forces the rest of the article to use natural variants, which is what you wanted anyway.
Count the output, not the source
This is where people get a number that is confidently wrong in both directions.
Count in your source file and you undercount, because a multi-word phrase wraps across two lines and a line-by-line search never sees it. Count in the finished web page and you can overcount by a huge factor, because modern sites embed a second copy of the whole page inside the HTML for the browser to use.
The three-step counting recipe
- 1.Strip the machinery. Remove scripts and embedded data before counting anything.
- 2.Separate the slots. Count the H1, the meta title and the meta description on their own. They are supposed to contain the keyword, so leaving them in the body count is what makes a correct article look like it is stuffed.
- 3.Collapse whitespace. Turn every run of spaces and line breaks into one space before searching. Otherwise a phrase that wrapped is invisible.
Six or two?
35 XP+9 perfectA check reports the primary keyword six times in body prose. The rule says exactly two. Before you start deleting, what do you do?
Pick the first move.
Finished reading?
Mark it done to bank the XP and keep your streak alive. Any challenges on this page score separately, so you can come back for a perfect run later.