Skip to main content

Headings and landmarks: The fastest way to improve AI extraction

Build enforceable heading hierarchies that machines parse cleanly so retrieval, extraction, accessibility, and citations stay accurate across formats.

- By Diane Kulseth - Updated May 14, 2026 Search Engine Optimization

Heading hierarchies for machine extraction and citation turn long documents into reliably addressable units that machines can retrieve, quote, and cite across formats.

When an AI search engine scans your page, it builds an outline tree from your headings. This tree determines how content gets chunked, labeled, and cited. Mess up the structure (e.g., skip a heading level, repeat generic titles, such as “Overview,” or use bold text instead of proper H2 tags), and citations will point to the wrong sections or break entirely.

Structural ambiguities cause problems: retrieval collisions, chunk-title drift, and citation failures. Traditional SEO focuses on keywords and backlinks, but the heading hierarchy determines whether machines can extract and cite your content reliably. A small set of rules eliminates most of these issues before they surface in search results or enterprise knowledge bases.

The following changes occur when your heading hierarchy works for machines:

  • AI search engines quote the right sections and cite back accurately, improving your content’s AI visibility.
  • Enterprise search surfaces precise answers instead of whole-page results.
  • Content exports from Word to PDF to HTML without losing structure.
  • Accessibility tools navigate cleanly through logical document outlines.

Let’s start with how parsers infer structure from your headings. Once you see what the machines do, the rules click into place.

The heading hierarchy standard (enforceable rules)

A small set of strict rules eliminates most extraction and citation failures.

Teams spend weeks debugging why their content won’t surface in AI search, only to find the problem was three skipped heading levels and a dozen sections all titled “Overview.” The machines weren’t broken; the document structure was.

Exactly one H1 per page or document

Your H1 should match your page title. Multiple H1s confuse scope detection, and parsers can’t tell where the document starts.

No skipped levels

H2 jumps to H4? Parsers lose track of section nesting. Every level connects: H1 → H2 → H3. Skip a level, and the outline tree breaks.

A heading describes unique topics

Ban generic titles such as “Overview” or “Conclusion” unless you add context. “Overview: Authentication” tells machines what that section covers. When five sections share the title “Details,” citations point to nowhere useful.

A heading’s text stays unique within the document

Two “Requirements” sections? Make them distinct: “Requirements (API)” and “Requirements (Security).” Parsers use heading text as chunk labels. Duplicate headings mean ambiguous references.

Every heading owns real content

Empty headings or headings used for visual styling mess up outline inference. Each heading introduces a substantive section.

Limit depth to H3 by default

H4 works for tightly scoped sub-steps. H5 and H6? Rarely necessary unless you’re writing an encyclopedia. Deep nesting creates tiny chunks that fragment citations.

Keep headings scannable

Aim for three to 12 words. Front-load the key term. “Configure OAuth tokens” beats “How to configure the refresh mechanism for OAuth 2.0 authentication tokens in production environments.”

Stabilize anchors and IDs on the web

Auto-generating new heading IDs with every publish breaks citations. Keep anchors stable so references survive content updates.

Most content lives comfortably within these boundaries. Academic papers and technical specs occasionally require deeper nesting or repeated section titles, but those are exceptions that prove the rule.

How parsers infer structure (what machines do)

Machines build an outline tree from your headings, and your job is to make that tree unambiguous and stable so chunking, labeling, and citations work reliably.

I find it helpful to think of parsers as ruthlessly literal readers. They don’t skim for meaning or forgive structural sloppiness. They see your headings and build an outline tree based on level hierarchy: H1s at the top, H2s as main branches, and H3s as sub-branches. This tree determines everything downstream: how content gets chunked, what labels these chunks receive, and where citations point.

Here’s the process:

Step 1: Outline tree construction. A parser reads your document and assigns each heading a position in the tree based on its level. An H1 becomes the root. H2s branch directly from it. H3s nest under their parent H2. If you skip a level (e.g., H2 to H4), the parser guesses where the H4 belongs and guesses wrong half the time.

Step 2: Chunk boundaries. Headings mark where one section ends and the next begins. The parser splits your content at these boundaries, creating discrete chunks. Each chunk gets a title, usually pulled directly from the nearest heading. So if your heading says “Overview,” that chunk’s title is “Overview,” along with every other chunk titled “Overview” across your site.

Step 3: Metadata and labels. These chunk titles serve as metadata for retrieval by deep learning models scanning for relevance signals. When someone searches “API authentication requirements,” the system scans chunk labels first. Modern information retrieval systems prioritize well-structured content with clear heading hierarchies. Generic headings such as “Requirements” force the parser to look deeper into the content itself, slowing retrieval and reducing accuracy.

Step 4: Citation assembly. When AI engines quote your content, they need to cite the source. For web pages, this means a URL plus a section identifier, typically the heading text or an anchor ID. For PDFs, it’s the page number and the section title. For Word docs, it’s the heading from the navigation pane. A bad hierarchy means the citation points to the wrong section or fails to generate at all.

The outline tree isn’t just internal plumbing. It surfaces everywhere: table of contents, site navigation breadcrumbs, Google’s sitelinks, accessibility tools, and every citation that references your work. If you make the tree ambiguous, all of these break in small but annoying ways.

Most AI citations fail because of structural errors, not model mistakes.

After auditing hundreds of documents with broken citations, I’ve noticed the same patterns repeating. The frustrating part? These failures are invisible until someone tries to quote your content and the reference points to the wrong section, or nowhere at all.

Skipped levels (H2 → H4). Your outline shows: H2 “API Setup” and jumps to H4 “Token Configuration.” The parser assumes that H4 belongs under the previous H3, which doesn’t exist. Result: “Token Configuration” gets nested under the wrong parent section, and citations reference the wrong scope.

Repeated generic headings. Three sections titled “Overview” are across your documentation. When an AI quotes the security overview, the citation points to the infrastructure overview instead, and the parser can’t distinguish between identical labels.

Typography as heading. You bold “Authentication Methods” and increase the font size in Word, but don’t apply the H2 style. Export to PDF or HTML, and that section disappears from the outline tree entirely. Parsers see it as emphasized text, not structure.

Heading drift across templates. The same content appears in three formats: “User Authentication” in HTML, “Authenticating Users” in the PDF, and “Authentication Process” in Word. Citations break across exports because the section identifier keeps changing.

Over-nesting (H5/H6). Your document uses six heading levels. Each H6 creates a small chunk of maybe two sentences, so citations become uselessly granular. Instead of referencing “API Authentication,” the citation points to “Step 3a: Refresh token rotation in production environments.”

Fix the structure, and these failures vanish.

Format-specific guidance: HTML, Word, PDF, Markdown

The same hierarchy rules must be implemented differently depending on the format, and validation must match the medium.

Heading hierarchy standards sound universal until you try enforcing them across HTML, Word docs, PDFs, and Markdown files. Each format has its own quirks, failure modes, and validation requirements. What works perfectly in HTML can break spectacularly when exported to PDF. A Word doc with pristine visual hierarchy might have zero semantic structure under the hood.

HTML

You’ll want to use semantic styled to look like headings. Make sure your DOM order matches the visual order. Sometimes CSS reorders elements, which can confuse screen readers and parsers. Keep your heading IDs stable across deploys because auto-generated IDs that change with every publish break citations instantly.

Validate by checking the browser’s document outline, inspecting the accessibility tree, and viewing the page source to confirm your heading tags and IDs are clean. Most CMS platforms show a crawl preview, so use it.

Word

Use the built-in heading styles (e.g., H1, H2, H3) rather than manual formatting. Lock your templates to prevent contributors from applying bold text and larger fonts instead of proper styles, because manual numbering without semantic styles might look fine on screen, but exports as plain text.

Validate using Word’s navigation pane since it shows the outline tree Word sees. Then export to HTML or PDF and recheck your headings to catch any conversion failures before you distribute the document.

PDF

You need to produce tagged PDFs with preserved heading tags and, where possible, include a table of contents bookmark panel. Untagged PDFs force parsers to guess structure from font size and position, which fails more often than it works. Scanned PDFs are even worse since they’re just images of text with zero semantic structure.

Validate by opening the PDF tag tree in Acrobat (or an equivalent tool), performing a spot check of text extraction, and confirming that your downstream system detects headings correctly.

Markdown

Enforce consistent heading conventions in your templates: pick ATX-style (and stick with it. Make sure your Markdown-to-HTML converter preserves or generates stable IDs for headings because mixing ATX (#) and Setext (underlines) styles inconsistently creates ambiguity.

Validate by rendering to HTML and confirming that your heading levels and anchors match expectations. Run a linter in CI to catch errors before merging.

Citations and anchors: what citable structures require

Accurate citations depend on stable boundaries and identifiers, not just on nice headings.

After years of tracking down broken citations, I’ve learned that the problem usually isn’t the AI model or the search algorithm. It’s that the content itself doesn’t provide stable reference points. Your headings create the boundaries, but anchors and IDs make those boundaries addressable across time and formats. Academic citation systems such as Google Scholar rely on stable section identifiers to maintain reference integrity across format changes.

In HTML, each heading can have an ID attribute that becomes part of the URL fragment: yoursite.com/docs#authentication-methods. When someone cites that section, the link points directly to it. But if your CMS regenerates that ID as authentication-methods-v2 after an update, all existing citations break. So keep your anchor IDs stable even when you revise heading text.

PDFs work differently since they use page numbers and sometimes bookmark metadata to create references. Tagged PDFs preserve heading information that helps citation tools identify sections by name rather than just page location. Without tagging, a citation might reference “page 47” with no indication of which section that is.

Word documents rely on the navigation pane outline, which pulls from your heading styles. If you bold text instead of using the H2 style, that section won’t appear in the outline and can’t be reliably cited.

Your citable structure checklist:

  • HTML: Assign stable, meaningful IDs to all headings and avoid auto-generation.
  • PDF: Produce tagged PDFs that preserve the heading hierarchy.
  • Word: Use built-in heading styles so the navigation pane reflects the true structure.
  • All formats: Keep heading text stable or maintain redirects when you restructure.

Stable structure means citations survive redesigns, migrations, and format conversions.

Validation playbook and governance (how to keep it true at scale)

Without checks, the heading hierarchy decays. Governance and automation keep citations stable.

Teams launch with a perfect heading structure only to watch it crumble within six months. Someone skips a level to match a design comp. A contractor applies bold text instead of proper heading styles. Regional teams launch new templates without reviewing the structural standards. Before long, your outline tree is a mess, and citations are breaking across your documentation.

The fix isn’t stricter rules but better enforcement at the right moments. You need manual checks for edge cases, automated validation for routine errors, and clear ownership to prevent standards from drifting.

Manual editor checklist:

  • Count your H1s (should be exactly one per page).
  • Confirm that no levels are skipped in the hierarchy.
  • Check that headings are unique and descriptive, not generic.
  • Verify no empty sections under headings.
  • Scan for typography being used as structure (bold text instead of heading tags).

Automated validation:

  • Set up lint rules in your CMS or CI pipeline to catch skipped levels and duplicate headings and apply basic principles of computer science to content governance.
  • Implement template enforcement to prevent contributors from breaking the structure.
  • Run a reporting dashboard that flags problem pages for batch fixes.
  • Automate heading ID checks to help anchors stay stable across deploys.

Ownership model:

  • Assign a content operations lead or technical documentation manager to own the standard.
  • This person sets rules, trains contributors, and reviews high-visibility pages before launch.
  • Enforcement happens at publish time through automated checks and template locks.

Migration guardrails:

  • Map old anchors to new ones with redirects when you redesign or migrate content.
  • Run regression tests on critical pages to confirm citations still resolve correctly.
  • Document anchor changes so external references don’t break after relaunch.

Validation becomes a habit when you build it into the workflow, not when you bolt it on after problems surface.

Keep your outline machine-readable

Enforceable rules, along with validation, make content reliably retrievable and citable.

Most citation failures stem from structural sloppiness: skipped heading levels, generic section titles, and unstable anchors. But you don’t need a complex governance program or expensive tooling to fix it. Start with the ruleset: one H1, no skipped levels, and unique descriptive headings. Run the format-specific checklist for your primary content type (e.g., HTML, Word, PDF, or Markdown). Then build validation into your publishing workflow so bad structure gets caught before it goes live.

The outcome? AI search engines quote you correctly. Enterprise search surfaces precise answers. Citations survive migrations and redesigns. Your content becomes reliably addressable across every system that parses it.

Ready to make your content work harder across every format and system? Request a demo to see how Siteimprove helps teams maintain a clean structure at scale.

Diane Kulseth

Diane Kulseth

With over a decade of digital marketing experience, Diane Kulseth is the Manager for Digital Marketing Consulting at Siteimprove. She leads the Digital Marketing Consulting team in providing services to Siteimprove's customers in SEO, Analytics, Ads, and Web Performance, diagnosing customer needs and delivering custom training solutions to retain customers and support their digital marketing growth.