Sub topic 12
Writing pages that are easy to retrieve and quote
This chapter assumes you know how a retrieve-then-generate pipeline works: a query is rewritten, candidate pages are retrieved and ranked, passages are extracted into the model's context, and the model writes an answer with citations. It also assumes you can read basic HTML. Here we turn that pipeline into concrete page-writing habits.
No writing style guarantees a citation. Engines differ, and results vary between runs. What you can do is remove obstacles at each stage, so that when your page is a good match, nothing stops it from being retrieved, extracted, and quoted.
Why page writing matters at each stage
A page has to survive three filters in order.
- Retrieval. The page must be in the index and match one of the rewritten queries, by keywords, by meaning, or both.
- Extraction. The engine pulls out a passage, not the whole page. The passage must make sense without the text around it.
- Citation. The model must be able to support a specific claim from that passage, so the claim needs to be stated plainly.
Make the content available as text
Retrieval systems read the HTML that a crawler receives. If your key content appears only after JavaScript runs, some crawlers will not see it. Several AI-related crawlers are known to fetch HTML without running scripts, though behavior varies by engine and can change.
Practical rules:
- Put the main content in the server-rendered HTML. Check by running
curlon the URL and searching the output for a key sentence. - Do not hide important text inside tabs or accordions that load on click, unless the text is in the initial HTML.
- Do not put key facts only in images, charts, or PDFs without a text equivalent. Give images descriptive
alttext and state the chart's conclusion in a sentence. - Make sure the page returns HTTP 200 and is not blocked by a login wall or a cookie wall that replaces the content.
curl -s https://www.example.com/guide | grep -c "rotate your API keys every 90 days"A result of 0 means the sentence is not in the raw HTML. A crawler that does not run JavaScript will not see it either.
Write headings that look like questions people ask
Query rewriting turns a user's question into one or more search queries. Headings are strong signals for what a section is about, and they often become the label attached to an extracted passage. A heading such as "Overview" tells a retriever little. A heading such as "How often should you rotate API keys?" matches the way people phrase the question.
| Weak heading | Stronger heading |
|---|---|
| Overview | What is key rotation? |
| Details | How often should API keys be rotated? |
| Other notes | What happens if a rotated key is still in use? |
Keep one topic per heading. Use a logical order of h1, h2, h3 without skipping levels. Do not stuff headings with keyword lists, because that makes them harder to read for people and gives no extra benefit.
Lead each section with the answer
Extraction typically picks a short span of text, often a paragraph or a few sentences. If the answer sits in the fourth paragraph after a long introduction, the extracted span may contain only the introduction.
Put the direct answer first, then the reasoning, then the exceptions.
Less quotable:
> Key management has many aspects, and teams have debated the right cadence for years. Several factors influence the choice...
More quotable:
Rotate API keys at least every 90 days, and immediately after any suspected exposure. Shorter intervals reduce the time an attacker can use a leaked key, but they raise the operational cost of updating every client.The second version works as a standalone quote. A model can lift it into an answer and the claim is still complete.
Write self-contained passages
A passage pulled out of its page loses the surrounding context. Check each paragraph by asking: if this were the only text a reader saw, would it make sense?
Common problems and fixes:
- Dangling pronouns. "It expires after 30 days" does not say what "it" is. Write "A session token expires after 30 days."
- Relative references. "As mentioned above" and "see the table below" break when the passage is isolated. Restate the fact.
- Undefined terms. Define an abbreviation near each use that matters, not only once at the top of the page.
- Missing subject and scope. "Supported on all plans" is unclear. "Single sign-on is supported on all paid plans" can be quoted.
State facts precisely and with context
A grounded answer attaches a claim to a source. Models and users both prefer claims that are specific and checkable.
- Give numbers with units and conditions: "Requests are limited to 60 per minute per API key," not "Rate limits are generous."
- Name the version, product, or date a fact applies to: "As of version 4.2."
- Say who is making the claim and why they know. Link to the primary source when you cite one, such as a standard, a specification, or a dataset.
- Separate fact from opinion. A sentence that mixes both is hard to quote safely.
Avoid claims you cannot support. An engine that pulls a wrong or vague statement from your page reproduces your error under your URL.
Use lists and tables for naturally structured information
Steps, comparisons, and parameter lists are easier to extract when they are marked up as such. Use ol for ordered steps, ul for unordered sets, and a real table element with header cells for comparisons. A table built from images or from div elements styled to look like a grid loses its structure when the page is converted to text.
Keep each list item a complete thought. A table cell that says "Yes" is meaningful only next to its row and column headers, so repeat the subject in the row's first cell.
Show dates and authorship
Many questions are time-sensitive, and engines often prefer recent sources for them. Show a visible "Last updated" date and keep it honest: change it only when the content changes. Name the author and give a short bio or link to an author page. The Article markup covered in the structured data chapter can state the same facts in machine-readable form, but the visible text matters because that is what gets extracted.
Keep one URL per question
If the same answer lives on five near-duplicate pages, engines must choose among them, and the signals split. Consolidate duplicates, use a rel="canonical" link to name the preferred URL, and give each page a distinct purpose. A page that answers one question thoroughly is usually easier to cite than a long page that touches twenty topics shallowly. Long reference pages are fine when their sections are clearly headed and self-contained.
A before-and-after example
Before:
<h2>Overview</h2>
<p>There are many things to think about with backups. It depends on your needs, and we discuss this below.</p>
<p>It is usually done nightly.</p>After:
<h2>How often should you back up a production database?</h2>
<p>Back up a production database at least once every 24 hours, and take continuous transaction-log backups if you cannot afford to lose more than a few minutes of data.</p>
<p>A nightly full backup limits data loss to at most one day. Continuous log backups let you restore to a specific point in time.</p>The revised version has a question-style heading, an answer in the first sentence, no dangling references, and specific figures. Each paragraph can be quoted alone.
Common errors
- Writing for keyword density instead of clarity. Repeating a phrase does not help a semantic retriever and makes text harder to quote.
- Burying the answer after a long story or a marketing introduction.
- Hiding content behind scripts, tabs, or login walls.
- Updating the "last updated" date without changing content. This can erode trust in your dates.
- Treating these practices as a switch. They raise the odds that your page is usable. They do not make a citation certain.
Exercise
A paragraph reads: "As discussed earlier, it supports this on all of them. See the table below for details." Name two problems that make it hard to extract and quote, and describe how to fix them.
Show answer
First, "it," "this," and "all of them" are dangling references, so the passage has no stated subject once it is separated from the page. Second, "as discussed earlier" and "see the table below" point to text that will not be in the extracted passage. Fix it by naming the subject and restating the fact, for example "Single sign-on is supported on all paid plans," and by including the key details in the sentence rather than pointing elsewhere.
Exercise
You run curl on a page and a key sentence you can see in your browser is missing from the output. What is the likely cause, and what should you change?
Show answer
The sentence is probably added by JavaScript after the page loads, so it is not in the raw HTML that a crawler without script execution receives. Move the content into the server-rendered HTML, for example by using server-side rendering or static generation, and run curl again to confirm the sentence appears.