Sub topic 4
Write Headings That Describe the Section's Answer
This chapter assumes you can already build a single-h1 heading hierarchy without skipped levels, and that you know how retrieval-based answer systems split a page into passages. Here the question is what the heading text should say. The tags are already correct.
Why heading text matters to retrieval
A retrieval-based answer system usually splits a page into passages and scores each one against the user's question. Many systems keep the nearest headings with each passage, either as a label or as extra text added to the passage. Details differ between systems and change over time, so treat this as a common pattern, not a guarantee.
The heading is often the first words of the passage the system scores. It may also be the only context a passage carries when it is shown away from the page. A passage under "Overview" has no context. A passage under "How long does a refund take?" has a clear subject.
Descriptive headings help three kinds of reader:
- Retrieval systems, which match the question to the passage label.
- Screen reader users, who often navigate by listing headings and need each one to make sense out of order.
- Skimmers, who read only headings and decide where to stop.
A good test is to read only your headings, top to bottom. If you can reconstruct what the page says, the headings work.
Descriptive headings versus generic labels
A descriptive heading names the specific topic or the answer the section gives. A generic label names only the kind of content. "Overview", "Details", "More information", and "Benefits" could appear on any page, so they carry no information.
| Weak heading | Problem | Stronger heading |
|---|---|---|
| Overview | Names a content type, not a topic | What the Team plan includes |
| Details | Could belong to any section | Supported file formats and size limits |
| Step 3 | Meaningless out of order | Connect the router to your modem |
| Pricing | One word, unclear scope | Pricing for the Basic and Team plans |
| Why it matters | Depends on the previous section | Why unencrypted backups are a risk |
| Other | Catch-all | Known limitations of the free tier |
Three habits produce stronger headings:
- Include the subject noun. Write "Refund time for card payments" instead of "Timing".
- Prefer specific over clever. "The fine print" is a joke to a human skimmer and an empty label to a system.
- Name the answer when it is short. "Sessions expire after 30 minutes" is a valid heading, because the heading and the answer agree.
Question-style headings
A question-style heading phrases the section title as the question a reader would ask: "What does a factory reset do?" This matches how people type queries and how they speak to assistants, so the heading's wording can sit close to the query's wording.
Use a question heading when:
- the section answers one clear, common question;
- the question has a short, direct answer you can put in the first sentence;
- the page is a how-to, a help article, or a reference where readers arrive with questions.
Prefer a statement or a noun phrase when:
- the section is a description, a comparison, or a narrative with no single question behind it;
- forcing a question would make the wording awkward ("What about the specifications?");
- the heading is a label for a table, such as "Plan comparison".
Do not turn every heading into a question. A page where all twenty headings are questions looks mechanical and reads badly. Mix forms and choose each by what the section does.
Question wording also has rules:
- Use the reader's words. If users search "reset password" and your product calls it "credential recovery", the heading should say "How do I reset my password?" Put your internal term in the body.
- Keep one question per heading. "What is a factory reset and when should I use it?" asks two things. Split it into two sections.
- Do not write a question you never answer. A heading that promises a direct answer must be followed by one in the first sentence.
The heading and the first sentence must agree
A heading makes a promise. The next sentence has to keep it. This is the link between this chapter and answer-first writing.
Here is a mismatch:
<h2>How long does a refund take?</h2>
<p>We care about customer satisfaction and process every request carefully.</p>A system that quotes the first sentence under this heading quotes nothing useful. Fix it by answering directly:
<h2>How long does a refund take?</h2>
<p>Refunds to a card take 5 to 7 business days after approval.</p>If you rename a section, re-read the first sentence. Drift between the two is one of the most common errors on edited pages.
Make the heading work without its neighbours
A passage may be shown with no surrounding text. So a heading should not depend on the section before it or on the page title. Avoid pronouns and back-references:
- "Why it matters" becomes "Why unencrypted backups are a risk".
- "The second option" becomes "Option 2: restore from a snapshot".
- "Continued" becomes a heading that names the continued topic.
The same applies to repeated template sections. A product catalogue where every page has "Specifications", "Reviews", and "Shipping" produces headings that are identical across hundreds of pages. Add the product name or the attribute where the template allows: "Specifications of the TX-200 router".
Edge cases
Duplicate headings on one page. Two sections both titled "Examples" cannot be told apart. Differentiate them ("Examples of valid dates", "Examples of invalid dates"). Duplicates also create ambiguous anchor links.
Length. A heading should be long enough to name the topic and short enough to scan. Roughly 3 to 12 words works for most sections. A heading of 25 words is a paragraph in disguise.
Keyword stuffing. "Router reset, factory reset router, reset router default settings" is not descriptive. It reads as spam to people and adds no meaning. One natural phrase is enough.
Clickbait. "You won't believe what a reset does" hides the answer. It also breaks the agreement between heading and first sentence.
Changing headings later. If anchor links or other pages point at a heading's id, renaming the heading can break them when the id is derived from the text. Keep the id stable when you reword, or add redirects.
Headings inside components. Cookie banners, "related posts" widgets, and newsletter boxes often contain headings. They enter the outline and may be attached to passages. Use a non-heading element, such as a styled p or a div with an accessible label, for interface text that is not part of the document's outline.
Translated pages. Write headings natively in each language. A literal translation of a question heading may not match how people phrase that question locally.
Acronyms and product names. Spell out an acronym in the heading the first time it appears on the page when readers may not know it: "What is SSO (single sign-on)?"
Deciding what a heading should say
The flow below summarises the choices.
A worked rewrite
Here is a weak outline from a help page, followed by a rewrite.
<h1>Help</h1>
<h2>Overview</h2>
<h2>Getting started</h2>
<h3>Step 1</h3>
<h3>Step 2</h3>
<h2>Troubleshooting</h2>
<h3>Problems</h3>
<h2>More</h2>Every heading is a generic label. A system or a screen reader user listing headings learns nothing. The rewrite is:
<h1>Set Up and Fix Your Backup Agent</h1>
<h2>What does the backup agent do?</h2>
<h2>How do I install the backup agent?</h2>
<h3>Download the installer for your operating system</h3>
<h3>Link the agent to your account</h3>
<h2>Why does my backup fail with error 4012?</h2>
<h3>Error 4012 caused by a full disk</h3>
<h2>Limits of the free plan</h2>The hierarchy is unchanged: one h1, no skipped levels. Only the text changed, and the outline now describes the page. The section "Limits of the free plan" is a noun phrase, because no single common question sits behind it.
Checking heading text with a script
You can catch the most mechanical problems automatically: generic labels, very short headings, and duplicates. This script reuses the outline-extraction idea from the previous chapters and adds text checks. It uses only the standard library.
import re
from html.parser import HTMLParser
GENERIC = {
"overview", "introduction", "details", "more", "info", "information",
"miscellaneous", "other", "faq", "faqs", "summary", "features",
"benefits", "resources", "notes", "about", "general",
}
class Headings(HTMLParser):
def __init__(self):
super().__init__()
self.level = None
self.buffer = []
self.found = []
def handle_starttag(self, tag, attrs):
if re.fullmatch(r"h[1-6]", tag):
self.level = int(tag[1])
self.buffer = []
def handle_data(self, data):
if self.level:
self.buffer.append(data)
def handle_endtag(self, tag):
if self.level and tag == "h" + str(self.level):
text = " ".join("".join(self.buffer).split())
self.found.append((self.level, text))
self.level = None
def review(headings):
problems = []
seen = set()
for level, text in headings:
key = text.lower().rstrip("?:. ")
words = re.findall(r"[A-Za-z0-9']+", text)
if key in GENERIC:
problems.append((level, text, "generic label"))
elif level > 1 and len(words) < 3:
problems.append((level, text, "too short to name an answer"))
if len(words) > 15:
problems.append((level, text, "too long to scan"))
if key in seen:
problems.append((level, text, "duplicate of an earlier heading"))
seen.add(key)
return problems
html = """
<h1>How to Reset a Router</h1>
<h2>Overview</h2>
<h2>Step 3</h2>
<h2>What does a factory reset do?</h2>
<h2>Pricing</h2>
<h2>Overview</h2>
"""
parser = Headings()
parser.feed(html)
for level, text, reason in review(parser.found):
print(f'h{level} "{text}": {reason}')Running it prints:
h2 "Overview": generic label
h2 "Step 3": too short to name an answer
h2 "Pricing": too short to name an answer
h2 "Overview": generic label
h2 "Overview": duplicate of an earlier headingThe script has limits. It cannot tell whether a heading is accurate, whether it matches the first sentence, or whether it uses your readers' words. A heading like "Things to know" passes the script and still says nothing. Treat the output as a list of places to look, and finish with the manual check of reading the headings alone.
Common errors, in short
- Using generic labels because they are quick to write.
- Writing a question heading and then opening with background instead of the answer.
- Making every heading a question.
- Using headings that depend on the previous section.
- Leaving identical headings across many template-generated pages.
- Letting interface widgets add headings to the outline.
Exercise
A help page has the heading "Details" followed by the sentence "Invoices are emailed on the first business day of each month." Rewrite the heading in two ways: once as a question heading and once as a statement heading. Then explain why each is better than "Details".
Show answer
Question form: "When are invoices sent?" Statement form: "Invoices are emailed on the first business day of each month" or the shorter noun phrase "Invoice delivery schedule". Both are better than "Details" because they name the subject, so a passage quoted without the rest of the page still has context. The question form also matches how a reader would phrase the query, and the first sentence already answers it directly. "Details" could label any section on any page.
Exercise
A product template gives every page the headings "Specifications", "Reviews", and "Shipping". Name two problems this causes and one fix that keeps the template.
Show answer
Problem 1: the same heading text appears on many pages, so a passage under it has no product-specific context when quoted alone. Problem 2: the headings are one-word labels that do not describe the answer. A fix that keeps the template is to build the heading from a field, for example "Specifications of the {product name}", "Customer reviews of the {product name}", and "Shipping options for the {product name}".