SEO for documentation: one page per task, the task as the heading
Docs win technical searches and citations. They are what assistants quote. You get there with one page per task, clear version signals, and pages that render in HTML. This guide gives you the pattern and the traps to avoid.
By Théophile Louvart, founder of Porteur · Updated 14 September 2026 · Markdown
Why documentation is where you win citations and trials
For developer tools and technical products, buyers search by task and by errors. They type "how to export CSV in YourProduct", "YourProduct vs OtherTool", "YourProduct error E0123".
Documentation pages rank for these because they answer the task, show code, and use the product’s terms. Assistants pull from them and cite them in answers.
- GitHub READMEs and package registries rank on tool names. Your docs win the task and error searches.
- Stack Overflow and forum threads rank on problems. Your docs should solve them before they do.
- A dated changelog and an integrations page pick up long tail searches over time.
You see this on generic queries like "hugo documentation" and "bigquery documentation". The docs are the result and the citation. Aim for that status for your product terms and tasks.
The page pattern that ranks and gets cited
One task per page. The task as the H1. The answer first. Then options, tabs, and notes. Keep each page self contained and link out for background.
Pick the task
Name it like a searcher would. Example: "/docs/export-csv" with H1 "Export CSV". Not "Data egress".
Lead with the answer
The first paragraph should solve it. Two to four steps or one code block that works as pasted.
Show a complete example
Put a minimal end to end example right after the steps. Example: curl command, expected response, and exit code.
Support common variants
Tabs for language or client, but keep the DOM for each variant in the HTML to keep it indexable. Example: JavaScript, Python, CLI.
Name objects consistently
Use the product’s exact feature and parameter names. Assistants match on names and structure.
Finish with links
Link to concepts, reference pages, and related tasks. Do not paginate a task.
A good page looks like "/docs/webhooks/retry-failed" with H1 "Retry failed webhooks". It opens with the curl to retry, the expected 200 response, then a note on idempotency and rate limits, and links to the webhook signing reference.
Reference and concepts live beside tasks, not instead of them
Split docs into tasks, reference, and concepts. Tasks answer how to do X. Reference names every parameter and code. Concepts explain why and trade offs.
- Reference pages rank on function and class names. They help assistants confirm details and units.
- Concepts help comparison and alternatives pages. They clarify what your product does and does not do.
- Cross link: from a task to the parameters it uses, from reference back to the task that applies them.
Example: "/docs/api/create-invoice" links to "/docs/reference/invoice" and to "/docs/concepts/invoicing-currencies". Each page stands alone and earns a query set of its own.
Versions, canonicals and what to publish
Versioned docs cause duplicates if you do not signal the current one. Keep one live URL per task for the latest stable version. Archive the rest cleanly.
Pick a canonical for each task
Make the latest stable the canonical. Example: "/docs/export-csv" is canonical for all version variants.
Add rel=canonical on old versions
On "/docs/v1/export-csv" and "/docs/v2/export-csv", set the canonical to "/docs/export-csv".
Clarify version on page
Show a version banner on archived pages. Example: "You are reading v1. This page may be out of date. See latest" with a link.
Decide what to index
Index latest stable. Noindex private betas and nightly builds. Keep URLs reachable for users who need them.
Redirect when you remove a version
If you delete "/docs/v1/", 301 redirect each task to the latest equivalent, not to the docs home.
Use consistent slugs across versions. Do not change "/create-invoice" to "/invoice-create" in v2. Keep query parameters and anchors stable if they are linked in the wild.
Search inside the docs that helps users and does not hurt SEO
Site search is for users, not for indexing. Keep search result pages fast, deduplicated, and scoped to docs. Do not let search pages replace your task pages.
- Expose search on "/search" or as an overlay, but keep task URLs canonical.
- Use synonyms and typo tolerance for product terms. Example: "web hook" finds "webhook".
- Show titles and short snippets. Link to the task, not to hash fragments that hide content behind tabs.
- Consider noindex for search results if they generate infinite combinations or thin pages.
- Log zero result queries. They are new tasks to write.
A good search experience keeps users on-page and reduces back and forth to external search. That lowers pogo sticking on results for your brand queries as people find answers in your docs first time.
llms.txt and robots controls for assistants and training crawlers
Assistants retrieve pages from web indexes and cite those that answer directly. To be named, your pages must be crawlable by the answering and search crawlers as of 2026.
- Allow Googlebot and Bingbot if you want to appear in Google and Microsoft results and in their assistants.
- Allow OAI-SearchBot, Claude-SearchBot, PerplexityBot, and Applebot if you want assistants to fetch and cite your pages.
- Use llms.txt to state your AI use policy. It is a declaration, not a ranking factor.
- Use Google-Extended or Applebot-Extended to control model training access. Blocking training does not remove data already collected.
- Separate policies: you can allow answering crawlers and disallow training crawlers.
Put the controls in robots.txt at the domain that serves the docs. Example for allowing answering bots while blocking training crawlers: allow Googlebot, Bingbot, OAI-SearchBot, Claude-SearchBot, PerplexityBot. Disallow GPTBot, ClaudeBot, Perplexity-User where required by your policy.
The changelog that earns long tail and proves activity
A dated changelog earns searches for versions, fixes, and features. It shows momentum to buyers and to assistants summarising your product.
One URL per entry
Example: "/changelog/2026-usage-limits". The list page links to each.
Open with the change
“We added per project usage limits” then the why. Keep titles specific.
Link to docs
From each changelog entry, link to the task or reference you changed. From the docs page, link back to the changelog entry.
Tag integrations
If the change touches "Zapier" or "Postgres", tag and link the integration page. That earns the long tail queries over time.
Keep dates accurate
Assistants quote dates. Make them correct and consistent across the site.
A strong entry looks like "2026: Retry failed webhooks" with a diff of the API response, the migration notes, and links to "/docs/webhooks/retry-failed" and "/docs/api/retries".
What breaks docs SEO and how to fix it
- Client rendered content
- Duplicate versions indexed
- Moving URLs without redirects
- Tabs that fetch content on click
- Missing code in HTML
- Index bloat from generated pages
- Blocked answering crawlers
Client rendered content
Fix by server rendering or static export. Check with curl that H1, paragraphs, and code are in source HTML.
Duplicate versions indexed
Fix by setting rel=canonical to latest, and noindex on archived versions where useful. Add visible banners and links up to latest.
Moving URLs without redirects
Fix by mapping old slugs to new with 301s. Do not redirect whole versions to the docs home.
Tabs that fetch content
Fix by rendering all tab panes in HTML and toggling with CSS or light JS. Keep code samples in the DOM.
Missing code in HTML
Fix your build. Do not syntax highlight at runtime if it hides code from crawlers. Pre render code blocks.
Index bloat
Fix by pruning thin or autogenerated pages and adding noindex to search results that produce infinite combinations.
Blocked answering crawlers
Fix robots.txt. Allow Googlebot, Bingbot, OAI-SearchBot, Claude-SearchBot, and PerplexityBot if you want citations.
Run a crawl of "/docs/" after each deploy. Check for canonical loops, 404s, and orphan tasks. In Search Console, watch for “Duplicate, without user selected canonical” on older versions and fix it at the template level.
Measure, learn, and write the next task
Use Search Console. Start with the Performance report filtered to "/docs/". Sort by queries. You will see tasks, errors, and exact phrasing your users type.
- Group by page to find winners you can improve with examples and links.
- Find striking distance queries where your task ranks on page 2 and add the missing step or code.
- Watch impressions that rise without clicks. Fix titles and H1s to match the task phrasing and add a short meta description.
Measure citations too. Ask assistants task questions and see who they cite. Example: ask “How do I retry failed webhooks in YourProduct”. If you are not named, read the answers that are cited and copy their clarity and structure. Being on the comparison and directory pages they already cite also helps.
Close the loop with analytics. Tag doc CTA clicks and free trial starts. For developer tools and B2B SaaS, many signups begin from a task page, not from the homepage. Keep docs fast and specific to protect that channel.
Questions
Use the structure you can maintain. A subdirectory keeps equity on one host, for example yourproduct.com/docs. A subdomain works if you can keep the same build, analytics, and robots controls. Do not split versions across hosts.
Render all code tabs in the HTML on the same URL. Use tabs to switch the visible block, not to fetch content. Keep the task H1 and intro the same. If a language needs a distinct flow, split it into its own task page and link both ways.
Usually no. They create many thin combinations and can outrank your task pages. Keep them fast and helpful for users. If you must index a few saved searches, set unique titles and descriptions and limit crawl with robots rules on parameters.
Yes. Static output is ideal for speed and HTML. Check that your theme renders code blocks and tab panels in the HTML. If you add client search, make sure it does not hide content until JavaScript runs.
Do not hide them. Ship pages like "/docs/migrate-from-other-tool" and "/docs/compare/feature-flags-vs-ab-tests" if they fit your product. Use neutral language and link from marketing pages. These queries convert on developer tools and B2B SaaS.
Keep them live at versioned paths with visible banners. Point rel=canonical to the latest stable. Add noindex where needed. Link forward to the latest task and back only when it helps a maintainer.
Sources
Check my site, free
Give your docs URL and get a free check in about thirty seconds that reads your site and the searches around it and shows three findings you can ship next.
- Free check, no card
- Read-only, your own accounts
- Readable by your agent
Read next
- Guidellms.txt: what it is, examples, and how to write yours
- Guiderobots.txt for AI crawlers: GPTBot, ClaudeBot, PerplexityBot and what to allow
- GuideCanonical tags: what they do and the mistakes that cost rankings
- GuideAlternate page with proper canonical tag: what Search Console means
- GuideInternal linking for a small site: which pages link to which
- GuideCore Web Vitals for a product site: the three numbers
- GuideSEO for developer tools: docs, comparisons, and the error message
- GlossaryContent audit